I have two mysql instances on the same machine. The settings are in the / usr / loca / mysql 1 and / usr / local / mysql2 directories.
I have separate my.cnf files located in / etc / mysql 1 and / etc / mysql2. I installed the first instance of my sql using the source distribution and with the option --prefix = / usr / local / mysql1. The second one I got from copying and pastinf the same directory in / usr / local / mysql 2.
When I run the mysql daemon on /usr.local/mysql/libexec, it reads the my.cnf file in / etc / mysql 1. And if I run the mysql daemon in / usr / local / mysql 2, it reads the same my file. cnf. I have separate port numbers and .sock files defined in a .cnf file in these two places.
I can read my.cnf file in second place using the -defaults-file = / etc / mysql2 / my.cnf option when mysqld starts. I do not need to enter this every time the daemon starts.
If I have more instances, how can I specify the correct my.cnf file for reading to each mysql daemon. What is retionale behind mysqld links with my.cnf file.
how can I predefine the location of the my.cnf file for each instance.
, MySQL . , , - defaults-file mysqld, . - data-dir, , MySQL, ( , ) , .
init script MySQL ; , "" . , , , , , .
MySQL ( , ), init script, "", (, , "" ), , . , init script .
, - . , bash script, mysql2 -defaults-file, , .
, "" , , . , PREFIX . , , , .
, , .