How to start mariadb/mysql instances at boot?
0
votes
1
answer
92
views
I've got a file /etc/mysql/mysqld_multi_cls.cnf with everyting mariadb needs for multiple database instances.
I can start these instances with the following command:
sudo mariadbd-multi --defaults-file=/etc/mysql/mysqld_multi_cls.cnf start
But I can't find a (neat) way to start these instances at boot.
Adding the .cnf file in the /conf.d/ folder doesn't start the instance, unless I'm messing up unknowingly.
The db is running on a Raspberry pi5, Raspberry Pi OS, which is Debian based. And I am quite unfamiliar/noob with Linux.
After request, here is the .cnf file:
# Configuration Settings for mysqld_multi , as well as separate instances.
#
[mysqld_multi]
mysqld = /usr/bin/mariadbd-safe
mysqladmin = /usr/bin/mariadb-admin
[mysqld2]
socket = /tmp/mysql.sock2
port = 3307
pid-file = /usr/local/mysql/mdb2/ansible-host1.pid2
datadir = /var/lib/mysql2
log-error = /var/log/mysql2/error.log
log-bin = /var/log/mysql2/mdb2-mysql-bin.log
server-id = 2
expire-logs-days = 72
sync_binlog = 1
innodb_flush_log_at_trx_commit = 1
innodb_flush_method = O_DIRECT
binlog_format = mixed
gtid_strict_mode = 1
[mysqld3]
socket = /tmp/mysql.sock3
port = 3308
pid-file = /usr/local/mysql/mdb3/ansible-host1.pid3
datadir = /var/lib/mysql3
log-error = /var/log/mysql3/error.log
log-bin = /var/log/mysql3/mdb3-mysql-bin.log
server-id = 3
expire-logs-days = 64
sync_binlog = 1
innodb_flush_log_at_trx_commit = 1
innodb_flush_method = O_DIRECT
binlog_format = mixed
gtid_strict_mode = 1
[mysqld4]
socket = /tmp/mysql.sock4
port = 3309
pid-file = /usr/local/mysql/mdb4/ansible-host1.pid4
datadir = /var/lib/mysql4
log-error = /var/log/mysql4/error.log
log-bin = /var/log/mysql4/mdb4-mysql-bin.log
server-id = 4
expire-logs-days = 64
sync_binlog = 1
innodb_flush_log_at_trx_commit = 1
innodb_flush_method = O_DIRECT
binlog_format = mixed
gtid_strict_mode = 1
Asked by Desert Wind
(43 rep)
Jan 20, 2025, 06:06 AM
Last activity: Jan 28, 2025, 02:24 AM
Last activity: Jan 28, 2025, 02:24 AM