Jump to content

.SQL into MySQL

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Guest_Lop_*

Guest_Lop_*
  • Guests
In a shell prompt how do I import a .SQL file into MySQL? I need to restore a test database that has gone bad.

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
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

#3
Guest_Lop_*

Guest_Lop_*
  • Guests
That works. How do I get it out in the .SQL file from shell?

#4
Guest_Jordan_*

Guest_Jordan_*
  • Guests
mysqldump -u <username> -p <database_name> > sqlfile.sql