I'm in real trouble here. First, thank you to all of you that will take the time to read my post.

So, I've followed tones and tone of tutorial to create multiple MySQL instances. On the paper, it's not complicated. I've followed this tutorial (in french, sorry, but it's not complicated to understand) http://www.bocciolesi.fr/tutoriels-et-cours/installer-plusieurs-instances-de-mysql/

I've created a separated my.cnf that I've named multi_my.cnf. Here is the content :

mysqld     = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
user       = multi_admin
password   = multi_admin
log         = /var/log/mysqld_multi.log

socket     = /tmp/mysql.sock2
port       = 3307
pid-file   = /var/lib/mysql2/hostname.pid1
datadir    = /var/lib/mysql2
#language   = /usr/share/mysql-8.0/mysql/french
user       = cube

Of course, I did a copy of the /var/lib/mysql folder to /var/lib/mysql2 and managed the permissions. In this side, I think everything is good. Also, my multi_admin user is configured.

But, when I run the command :

mysqld_multi -–defaults-file=/etc/mysql/multi_my.cnf start

And then, the command :

mysqld_multi -–defaults-file=/etc/mysql/multi_my.cnf report

I end up having :

Reporting MySQL servers
MySQL server from group: mysqld2 is not running

The same thing happens when I try to put the content of multi_my.cnf on the my.cnf file.

Here is the content of /var/log/mysqld_multi.log :

mysqld_multi log file version 2.16; run: lun. sept. 24 11:53:56 2018

Starting MySQL servers

2018-09-24T09:53:56.129051Z mysqld_safe Logging to '/var/log/mysql/error.log'.
2018-09-24T09:53:56.140844Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2018-09-24T09:53:56.389354Z mysqld_safe mysqld from pid file /var/lib/mysql2/hostname.pid2 ended
mysqld_multi log file version 2.16; run: lun. sept. 24 11:53:58 2018

Reporting MySQL servers
MySQL server from group: mysqld2 is not running

The thing that brings my attention here is that in the log, we can see that the daemon tries to use the databases from /var/lib/mysql. Shouldn't it be /var/lib/mysql2 ?

Any explanation would be much appreciated ! Thank you.

migrated from stackoverflow.com Sep 24 '18 at 10:37

This question came from our site for professional and enthusiast programmers.

  • This question has nothing to do with programming, this is pure admin task. You may get assistance on the DBA sister site of SO. – Shadow Sep 24 '18 at 10:14
  • IIRC, mysql_multi stopped being supported several years ago. – Rick James Oct 10 '18 at 4:27

The mysqld_multi manual states:

Usage: mysqld_multi [OPTIONS] {start|reload|stop|report} [GNR,GNR,GNR...]
or     mysqld_multi [OPTIONS] {start|reload|stop|report} [GNR-GNR,GNR,GNR,GNR,...]

Where GNR is the group number. So to start the mysqld2 server you should try:

mysqld_multi --defaults-file=/etc/mysql/multi_my.cnf start 2

And to start both:

mysqld_multi --defaults-file=/etc/mysql/multi_my.cnf start 1,2

You could also view an example mysqld_multi config to validate against yours with:

mysqld_multi --example
  • Hello, Thanks for your answer. Unfortunately, I've tried "start 2" tons of times, and the result is the same. EDIT : Here are the two conf files compared : Mine is [mysqld2] socket = /tmp/mysql.sock2 port = 3307 pid-file = /var/lib/mysql2/hostname.pid2 datadir = /var/lib/mysql2 user = cube and the example one is [mysqld2] socket = /tmp/mysql.sock2 port = 3307 pid-file = /var/lib/mysql2/hostname.pid2 datadir = /var/lib/mysql2 language = /usr/share/mysql-8.0/mysql/english user = unix_user1 – Antonin Jacob Sep 25 '18 at 6:19
  • You could check the parameters mysql using to start up. Client: my_print_defaults --defaults-file=/etc/multi_my.cnf mysql2 - Server: my_print_defaults --defaults-file=/etc/multi_my.cnf mysqld2 - or - mysqld --defaults-file=/etc/multi_my.cnf --defaults-group-suffix=2 --print-defaults - You can also try spawning the mysqld manually on the console to check if it really does start up successfully: mysqld --defaults-file=/etc/multi_my.cnf --user cube – socaire Sep 25 '18 at 13:48
  • Hi. There is only a mysqld_multi.log file in the /var/lib/ dir, but nothing in it. I've checked again /var/log/mysqld_multi.log and the exact sames lines as in my post appears, and the /var/log/mysql/error.log don't give any info about my instances. – Antonin Jacob Sep 25 '18 at 14:04
  • Ok, I just answered to your previous message before you edit it. I'm gonna check what you said tomorrow, I have to leave my workplace now. Thank you, I'll keep you in touch ! – Antonin Jacob Sep 25 '18 at 14:06
  • Hi again. Sorry for the long wait. So I've tried different things, now my conf are all in my.cnf. I haven't changed the datadir, but I tried couple time to set them in a different location, just to see what happens. I finally decided to reinstall Mysql after getting tons of errors, and now, the "normal" service works fine but mysqld --user [whatever] seems to load for a minute (I can't write anything on the console) and then, nothing. – Antonin Jacob Oct 1 '18 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.