Skip to content

Instantly share code, notes, and snippets.

@akozlik
Created March 1, 2014 20:24
Show Gist options
  • Save akozlik/9296627 to your computer and use it in GitHub Desktop.
Save akozlik/9296627 to your computer and use it in GitHub Desktop.
Useful MySQL command line instructions
// Dump an entire database
mysqldump --opt -u [uname] -p[pass] [dbname] > [backupfile.sql]
// Dump specific tables from a database
mysqldump -u root -p [dbname] [table1] [table2] > [backupfile.sql]
// Restore database from sql file
mysql -u [uname] -p[pass] [db_to_restore] < [backupfile.sql]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment