PDA

View Full Version : SQL restore question


JLB2414
11-26-2008, 02:29 PM
A while ago I made a machine switch. Using Navicat I exported my database to a .sql file. I just finished getting everything reworking, and built. I was wondering how you restore your db from a sql file? I just hope I didn't do it wrong :shock:

JLB2414
11-26-2008, 02:38 PM
Found the answer to my own question:

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]

worked like a charm, just in case anyone else ever wonders :-).

Now I can get to work!

trevius
11-26-2008, 05:34 PM
Or, in Navicat, you can create the database you want to use and right click that database and select "Run Batch File". That will do the same thing.