Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

try to restore a sql dump file larger than 10 GB

I am trying to restore a sql dump file that is 13G big. I firstly used phpAdmin in xampp, it said the size was too big. Then i used big dump, still I got the error message that " I can not seek in xx.sql". I found online that it means the file is too big. Then I start to use command line. mysql -u username -p database < location/to/your/dump.sql seems it is working because it asked for password, and I directly pressed enter because I do not have a password. And now i can see the "_" keeps flashing, i am assuming that this means it is working. BUt there is no way I can check to make sure, and it is taking a while already.

Is there a way to make sure it is working? I really appreciate your help!! TJ

like image 380
Tianjie Deng Avatar asked Nov 01 '13 01:11

Tianjie Deng


1 Answers

Another way to restore files with the mysql command line client is like this:

$ mysql -u username -p database 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2933685
--8<-- snip --8<--

mysql> source location/to/your/dump.sql 

The source command will read the dump file and apply it to the server just like the < redirection operator, but with two differences: you will see continuous "x rows affected" messages scrolling by, giving you some indication that progress is actually occurring. The down-side of this method is that, unlike the method using < redirection, if there are any errors in the dump file, the command line client will just try to keep going, which is not always what you want. Still, it might be a viable approach.

Or... the way you're doing it now, if you can see the connection in the processlist, check the value for Sleep. If the value is constantly 0, then some kind of activity is occurring.

like image 189
Michael - sqlbot Avatar answered Nov 16 '22 00:11

Michael - sqlbot