I have a .sql
file with an export from phpMyAdmin
. I want to import it into a different server using the command line.
I have a Windows Ser
To dump a database into an SQL file use the following command.
mysqldump -u username -p database_name > database_name.sql
To import an SQL file into a database (make sure you are in the same directory as the SQL file or supply the full path to the file), do:
mysql -u username -p database_name < database_name.sql