Follow

How can I import a database backup via SSH

Export a MySQL db to file:

mysqldump -h [SERVER] -u [USER NAME] -p [DATABAS]> dumpfil.sql

-> This command exports your database and saves it as "dumpfil.sql"

Import a MySQL db from file:

mysql -h [SERVER] -u [USER NAME] -p [DATABAS] <dumpfil.sql

-> This command imports your dump file into the database, it will overwrite existing tables of the same name!

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.