0

I have a second MySQL 8 instance running on Ubunut 20.04, started by this command:

mysqld_safe --defaults-file=/home/user/mysqld_replica.cnf &

The config file contains all needed settings like port, socket and data dir. That works well but I can not figure out how to start the second instance on boot.

What would be the recommended way to start both instances at boot time?

1 Answer 1

0

Copy /lib/systemd/system/mysql.service to /etc/systemd/system/mysql_replica.service.

In the copied service file add --defaults-file=/home/user/mysqld_replica.cnf to the ExecStart* directives as the first argument to mysqld.

Reload systemd to read this systemctl daemon-reload.

Start the service systemctl start mysql_replica.service.

Enable on boot with systemctl enable mysql_replica.service.

You many need a few quick apparmor fixes like this answer to enable writing on your second data directory.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.