MySQL SSH Export and Import Database in Shell Terminal

In your favorite shell you can export a MySQL database and Import using the following.
on Ubuntu, my MySQL databases are located at
/var/lib/mysql/database_name
To Export a MySQL Database run:
mysqldump -v -u username -p database_name > dumpfile.sql

To Import a MySQL Database run:

mysql -v -u username -p database_name < dumpfile.sql

 

Leave a Reply

Your email address will not be published. Required fields are marked *