Skip to content

Instantly share code, notes, and snippets.

@haakym
Last active August 24, 2018 08:56
Show Gist options
  • Save haakym/53a5db79d8ad42bef0ee05b942c16080 to your computer and use it in GitHub Desktop.
Save haakym/53a5db79d8ad42bef0ee05b942c16080 to your computer and use it in GitHub Desktop.
Commands to import and dump a DB

Command Line MySQL Dump and Import

Dump

mysqldump -u username -p database > dump-file-path.sql

To export data only:

mysqldump -u username -p --no-create-db --no-create-info database > dump-file-path.sql

Import

mysql -u username -p database < dump-file-path.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment