Mysql – Secondary thesql instance runs but thesqld_multi reports it is “not running”

MySQLmysql-5.7mysqld-multi

On my Ubuntu server, there are two mysql instances running at the same time.

  • A default, normal mysql instance
  • A secondary mysql instance running with mysqld_multi.

The command sudo service mysql status correctly states the mysql service is active.

I want to check the secondary instance's status so I use this command :

sudo mysqld_multi report

…and I get :

MySQL server from group: mysqld1 is not running

which seems pretty inconsistent since I can connect to this mysql instance from my DB client.

Why does mysqld_multi tell me the instance is not running ?

Best Answer

Check creation mysql instance dir, confirm mysql rights and install instance in dir

mkdir -p /u01/data/mysql/mysql1 && chown mysql:mysql /u01/data/mysql /u01/data/mysql/mysql1
mysql_install_db --user=mysql --datadir=/u01/data/mysql/mysqld1