Skip to content

Instantly share code, notes, and snippets.

@sergeycherepanov
Last active January 26, 2017 15:58
Show Gist options
  • Save sergeycherepanov/dfeba284d49aec83a09d12787c6937d4 to your computer and use it in GitHub Desktop.
Save sergeycherepanov/dfeba284d49aec83a09d12787c6937d4 to your computer and use it in GitHub Desktop.
full mysql dump without system db
MYSQLUSER='root' MYSQLPASSWORD='' MYSQLHOST='127.0.0.1' MYSQLPORT=3306; mysqldump -u$MYSQLUSER -p$MYSQLPASSWORD -h$MYSQLHOST -P$MYSQLPORT --databases `mysql --skip-column-names -u$MYSQLUSER -p$MYSQLPASSWORD -h$MYSQLHOST -P$MYSQLPORT -e "SELECT GROUP_CONCAT(schema_name SEPARATOR ' ') FROM information_schema.schemata WHERE schema_name NOT IN ('mysql','performance_schema','information_schema');"` > dump.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment