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

Want to support HowtoForge? Become a subscriber!
 
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.
Submitted by Das_omen (not registered) on Fri, 2011-03-25 15:05.

I have done this in many ways... with mysqldump , mysqlimport and phpmyadmin... I'm running an Ubuntu 10.04 server with apache2 / mysql installed... 

 When I try to import the server does nothing, no error and no responses... Any ideas what might be the problem!?

Submitted by PermaNoob (registered user) on Wed, 2010-10-13 00:22.
That's much faster and easier than using import in phpmyadmin or another mysql manager.