How to import large .sql files into MySQL via shell?

If you seek to import a large MySQL file via the shell in Linux, the following command might be helpful to you:

shell>mysql -uusername -ppassword db_name < dumpfile.sql

If you are already running mysql, you can execute an SQL script file using the source or \. command:

mysql> source dump.sql
mysql> \. dump.sql

Tags: , ,

One Response to “How to import large .sql files into MySQL via shell?”

  1. Polprav says:

    Hello from Russia!
    Can I quote a post in your blog with the link to you?

Leave a Reply