Skip to content

Instantly share code, notes, and snippets.

@webgodo
Last active October 23, 2016 13:27
Show Gist options
  • Save webgodo/b9459e113ccb2e64385f10733ebcb9ae to your computer and use it in GitHub Desktop.
Save webgodo/b9459e113ccb2e64385f10733ebcb9ae to your computer and use it in GitHub Desktop.
I've saved some of my repetitive & useful snippets of MySQL

MySQL Snippets

Login

mysql --host=localhost --user=USERNAME_HERE --password PASSWORD_HERE

Import .sql file into a database

mysql -u USER_NAME -p DB_NAME < /full/path/to/file_name.sql

Backup all databases in a single .sql file

mysqldump --host=localhost --user=USERNAME_HERE --password --all-databases > all_database s.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment