██▓▒­░⡷⠂𝚘𝚌𝚝𝚝 𝚒𝚗𝚜𝚒𝚍𝚎 𝚞𝚛 𝚠𝚊𝚕𝚕𝚜⠐⢾░▒▓██ on 2024-07-22T12:32:29Z [JSON]

Importing data into MySQL / MariaDB database from SQL dump file:

  1. Ensure database exists:
create DATABASE IF NOT EXISTS <db name>;
  1. Import data:
mysql <db name> < ./path/to/db.sql

See also: [[memos/AAXMo7MCQfyrDTJXnTsyr5]]

MariaDB specifically has a huge pitfall, the mariadb-import command: https://mariadb.com/kb/en/mariadb-import/ ...it seems to always give a strange error, mariadb-import: Error: 1146, Table '<db name>.Db' doesn't exist, when using table: Db, like it wants to append something to the db name. It's best to not use it, and use instead the above.