Skip to content

Instantly share code, notes, and snippets.

@jjjjcccjjf
Created January 29, 2017 07:47
Show Gist options
  • Save jjjjcccjjf/f7223d10e878fdbd9ab7819c552861e3 to your computer and use it in GitHub Desktop.
Save jjjjcccjjf/f7223d10e878fdbd9ab7819c552861e3 to your computer and use it in GitHub Desktop.
Importing/Exporting a MySQL database via SSH

Exporting a MySQL database

To export a MySQL database, you need to use the mysqldump command. Here is the full command for exporting your database:

mysqldump -uUSERNAME -pPASSWORD DATABASE > backup.sql

Importing a MySQL database

To import a MySQl database, you need to use the mysql command. Here is the full command for importing a MySQL dump into a database:

mysql -uUSERNAME -pPASSWORD DATABASE < backup.sql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment