Follow

Can I manage MySQL databases via SSH?

SSH is very good at both import and export MySQL databases with MySQL command, so you can do both :

Export a MySQL db to file:

mysqldump -h [ SERVER ] -u [username] -p [ DATABASE ]> dumpfil.sql

This command exports your database and save it as " dumpfil.sql "

Importing a MySQL db from file :

mysql -h [ SERVER ] -u [username] -p [ DATABASE ] < dumpfil.sql

This command will import your dump file to the database , it will overwrite the existing tables with 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.