This howto is tested on:

  • Debian 10.0 Buster


This howto requires:

This howto recommends:

Environment setup

Detect if sudo is available (“command” is used if not):

command type -f 'sudo' &>'/dev/null' && cmdProxy='sudo'


Enable MySQL binary log to allow for replication and to ensure data recovery in case of crash, and make sure data is written to disk at commit:

${cmdProxy} tee '/etc/mysql/conf.d/binary-log.cnf' <<< "[mysqld]
# Enable binary log for point in time recovery.
# see :
# Note: set sync_binlog to 0 for better performances at the cost of perfect data integrity.
log_bin = /var/log/mysql/mysql-bin.log

# Limit binary log size to prevent databases lock ups at binary log rotation.
# see :
max_binlog_size = 100M

# Write InnoDB data to disk at commit.
# Note: set to 2 for better performance at the cost of perfect data integrity.
# See
innodb_flush_log_at_trx_commit = 1"

Reload the database server configuration:

${cmdProxy} systemctl 'restart' 'mariadb'



Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.