Skip to content

Instantly share code, notes, and snippets.

@robpataki
Last active November 8, 2017 17:33
Show Gist options
  • Save robpataki/e525dfb0a2eb1361436b99e301cf1aa9 to your computer and use it in GitHub Desktop.
Save robpataki/e525dfb0a2eb1361436b99e301cf1aa9 to your computer and use it in GitHub Desktop.
MariaDB / MySQL notes

Important MySQL Commands

Enter MySQL

$ sudo mysql

List databases

$ show databases;

Create database dump (exit MySQL first)

$ sudo mysqldump database_name > backup_file.sql;

Restore database state from dump

$ sudo mysql
$ USE database_name;
$ source db_dump.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment