Skip to content

Instantly share code, notes, and snippets.

@Lovor01
Last active April 30, 2024 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lovor01/62860e882e9e604f2fde1c9f5c10900a to your computer and use it in GitHub Desktop.
Save Lovor01/62860e882e9e604f2fde1c9f5c10900a to your computer and use it in GitHub Desktop.
Database mysql/mariadb command line

Export database

mysqldump <database> --password=<password> --user=<user> --default-character-set=utf8 > <file>

on windows, use --result-file=<file> as default export is in UTF16

(or mariadb-dump)

Import database

mysql -u <username> <databasename> < <filename.sql>

Show tables

mysqlshow

Create database

mysql --user=root --execute="CREATE DATABASE nick_notas_new COLLATE = utf8mb4_unicode_520_ci;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment