In a shell prompt how do I import a .SQL file into MySQL? I need to restore a test database that has gone bad.
.SQL into MySQL
Started by
Guest_Lop_*
, Aug 08 2007 05:21 AM
3 replies to this topic
#1
Guest_Lop_*
Posted 08 August 2007 - 05:21 AM
Guest_Lop_*
|
|
|
#2
Guest_Jordan_*
Posted 08 August 2007 - 05:48 AM
Guest_Jordan_*
I've had to do this a lot for the users on my server. Once you have the dump it is always easiest to go through phpMyAdmin if possible but here is the shell command:
mysql -u USER -p DBNAME < dump.sql
mysql -u USER -p DBNAME < dump.sql
#3
Guest_Lop_*
Posted 14 August 2007 - 05:56 AM
Guest_Lop_*
That works. How do I get it out in the .SQL file from shell?
#4
Guest_Jordan_*
Posted 14 August 2007 - 10:01 AM
Guest_Jordan_*
mysqldump -u <username> -p <database_name> > sqlfile.sql


Sign In
Create Account

Back to top









