MySQL

20
Sep
2011

How to Import Large MySQL Dumps

To import sql dumps it's commonly used PhpMyAdmin. However, if the dump is too large, there some problems can appear such as file size limit, exceeding script execution time, memory shortage and so on.

So the best solution in this case (and the proper one) is to use mysql client utility via the console. For import sql dump we should use "source" statement.

  1. tulvit@tulvit-desktop:~$ mysql -uroot -proot;
  2. Welcome to the MySQL monitor. Commands end with ; or \g.
  3. mysql> use my_db;
  4. Database changed
  5. mysql> source ~/dump.sql;
  6. ...
Category: 
0