changing default my.cnf path in mysql

Posted by user377941 on Stack Overflow See other posts from Stack Overflow or by user377941
Published on 2011-01-08T13:50:00Z Indexed on 2011/01/08 13:53 UTC
Read the original article Hit count: 318

Filed under:
|
|

I am having two mysql instances on same machine. The installations are on /usr/loca/mysql1 and /usr/local/mysql2. I m having separate my.cnf files located in /etc/mysql1 and /etc/mysql2. I installed the first instance of my sql using source distribution and with the --prefix=/usr/local/mysql1 option. The second one i got from copying and pastinf the same directory to /usr/local/mysql2. When i start the mysql daemon on /usr.local/mysql/libexec it reads the my.cnf file in /etc/mysql1. And if i start the mysql daemon in /usr/local/mysql2 it reads the same my.cnf file. I have separate port numbers and .sock files defined in the .cnf file in those 2 locations. I can read the my.cnf file in the second location by using --defaults-file=/etc/mysql2/my.cnf option on mysqld startup. I dnt need to enter this each and every time i start the daemon. If i am going to have more instances how can i point the correct my.cnf file to read to each and every mysql daemon. What is the retionale behind mysqld links with the my.cnf file. how can i predefine the location of my.cnf file for each instance.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about multiple-instances