Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

2 Answers
2

This will allow you to run different configurations and different distros using the same configuration file (/etc/mysql/my.cnf) and you could adjust the init.d script to use the mysqld_multi commands instead of mysqld.

Another tool might be mysql sandbox, but I've never used that personally on any distro.

Actually Rolando, there is something to add :) I did get it going with mysqld_multi quite nicely. Apparently ubuntu runs app armor which protects various directories. Running mysql_install_db to my new datadir was failing even running as root. I had to update the apparmor config to allow the new paths appropriate access and then reload the apparmor config.
–
atxdbaSep 20 '11 at 22:15

One after thought comment I thought would be worth pointing out for others stumbling across the solution to their problem is the implementation of their my.cnf w/ mysqld_mulit. In short you'll have to add a [mysqld1] and [mysqld2] section to differentiate. In my.cnt I just used an !include directive like [mysql1] !include /etc/mysql/instanceA.cnf [mysql2] !include /etc/mysql/instanceB.cnf So I can edit instanceA.cnf or *B.cnf and not wonder which section i'm editing in a globbed together single my.cnf file. (Sorry for the formatting, i still need to figure this out..)
–
atxdbaSep 21 '11 at 3:11

I am in the same situation daily. Instead of using mysqld_multi, what works OK for me is installing each MySQL copy to a separate tree, then running mkdir -p data etc var/run var/log/mysql and copying-fixing paths in a skeleton my.cnf: