Skip to content

Instantly share code, notes, and snippets.

@mattantonelli
Created November 21, 2024 17:05
Show Gist options
  • Save mattantonelli/eccb8e888740f8605ec397b578d9fc20 to your computer and use it in GitHub Desktop.
Save mattantonelli/eccb8e888740f8605ec397b578d9fc20 to your computer and use it in GitHub Desktop.
Configure MariaDB to improve dump restore time
# /etc/my.cnf.d/mariadb-server.cnf
[mysqld]
innodb_buffer_pool_size = 4G # 50% RAM
innodb_log_file_size = 1G
innodb_flush_log_at_trx_commit = 0
innodb_doublewrite = 0
max_allowed_packet = 256M
# Load the dump, skipping uniqueness and foreign key checks
time mysql -u root -p -D my_database --init-command="SET SESSION FOREIGN_KEY_CHECKS=0; SET SESSION UNIQUE_CHECKS=0;" < dump.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment