How do I restore a MySQL database from an sql dump?

Submitted by falko (Contact Author) (Forums) on Mon, 2006-08-07 16:21. :: MySQL

If your MySQL user has a password:

mysql -h localhost -u [MySQL user, e.g. root] -p[database password] [name of the database] < [name of your sql dump, e.g. sqldump.sql]

Please note:  there's no space between -p and the password!

If there's no password:

mysql -h localhost -u [MySQL user, e.g. root] [name of the database] < [name of your sql dump, e.g. sqldump.sql]


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.