Skip to content

Instantly share code, notes, and snippets.

@zillingen
Last active November 3, 2017 19:50
Show Gist options
  • Save zillingen/184512422457c4a6997f5497af72cc8a to your computer and use it in GitHub Desktop.
Save zillingen/184512422457c4a6997f5497af72cc8a to your computer and use it in GitHub Desktop.
Backup and restore MySQL database with mysqldump

Backup and restore MySQL database with mysqldump

Create database dump:

mysqldump -uroot database_name > dump.sql

Restore database dump to mysql:

mysql -uroot < dump.sql

Or if database exists:

mysql -uroot database_name < dump.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment