Import MySQL Backup; Restore .SQL Export

Import a mysql backup by doing the following on the command line:

mysql -u USERNAME -p -h SERVER DATABASE < "/path/to/backup.sql"

Replace USERNAME, SERVER, DATABASE and "/path/to/backup.sql".

mysql -u someuser -p -h mydatabase < "~/Desktop/mybackup.sql"

To view the status of the import, check the process list.

$ mysql
mysql> show processlist;
This post is available on GitHub.
Posted .


Leave a Reply