Knowledge Base - FAQ

Question: How do I restore a database from a dump via the shell?

Here is the basic syntax:

mysql -h <hostname> -u <username> -p <database> < <backupfile.sql>

You can also do:

mysql -h <hostname> -u <username> -p <database>
create database <database>
use <database>
source <backupfile.sql>


Last Modified: Jan 20, 2006


Kattare is Trustwave Certified and Safe Harbor Certified | Rated Safe For Kids by ICRA | All Rights Reserved Worldwide
Copyright © 1997 - 2012 Kättare Internet Services | Processed in 0.014 seconds by pyramid-06 in Corvallis, Oregon