As we all know, MySQL reads all its individual component configurations from the my.cnf file. The problem is if you have a custom build and installed the binaries with prefix; then that $prefix/etc is also added to the list of paths for searching the my.cnf
We at Yahoo! has the same scheme; where all MySQL installation goes to /home/y and yahoo setup of my.cnf file is installed to /home/y/etc/my.cnf and a symlink is added in /etc/my.cnf.
With the above setup, when you start the mysqld server, it actually reads both the files from /etc/my.cnf and /home/y/etc/my.cnf in the same order.
1 2 3 4 5 |
Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf /home/y/etc/my.cnf The following groups are read: mysql_cluster mysqld server mysqld-5.1</blockquote> |
That seems reasonable. The problem is; there are few config parameters which can repeat with different values like Replicate-Wild-Do-Table and Replicate-Wild-Ignore-Table. As MySQL reads both the files and the values are actually repeated as duplicates. For example; for the above parameters, when you run SHOW SLAVE STATUS you will get duplicate values:
1 2 3 |
Replicate_Wild_Do_Table: test.%,venu.%,test.%,venu.% |
I still think this is a bug in MySQL. They should avoid the duplicate values for the same parameter even if they read it multiple times. One solution for this is explicitly passing –defaults-file=#, so that it limits to one particular file.