725 pts.
 Which config file does MySQL use?
Hi, I'm having trouble with MySQL. My OS is IBMi V7R1. We are using MySQL 5.0.45 with zend server 5.6.0. The problem is that the MySQL server works fine in qp2term(shell) but ends immediately after start with zend server. Also, when I check the defaults config file for MySQL I get this message: Default options are read from the following files in the given order: /etc/my.cnf ~/.my.cnf /usr/local/mysql/etc/my.cnf I am guessing that MySQL uses the configuration file in the last location '/usr/local/mysql/etc/my.cnf'? Is this so? Note that no my.cnf file found in that location, the config file was created by MySQL in '/etc/my.cnf'. So can this be the problem? If so how do I set MySQL to look for the '/etc/my.cnf' last instead of '/usr/local/mysql/etc/my.cnf'?

Software/Hardware used:
MySql 5.0.45, Zend Server 5.6.0
ASKED: March 5, 2013  2:55 PM
UPDATED: March 5, 2013  4:06 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question. Michael Tidmarsh   11,390 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

No, it’s not correct. If the .CNF file is found in the /etc directory and does not exist in later directories (or exists but has incorrect permissions), the /etc .CNF file controls everything. Are there any errors logged either in related joblogs or in MySQL log files? — Tom

 107,985 pts.

 

Also, how are you starting the MySQL server? The startup command can specify the location of a my.cnf file if you want a specific one to be used. — Tom

 107,985 pts.

 

No there are no errors in the log file when this happens. As for starting mysql, we start it by using the zend mysql management menu and selecting 1 to start MySql subsystem. When we do this and use WRKACTJOB , we see that ZMYSQL(mysql subsystem) is started along with ZMYSQLD(mysql server), but we see a DLYW status and after refreshing the screen it(ZMYSQLD job) disappears. Also note like i said we tried starting the mysql server using: qp2term cd /usr/local/mysql/bin mysqld_safe -uroot & and mysql works okay like this.And FYI its a new mysql installation and no password was set.

 725 pts.

 

The issue is getting mysql to start with zend but i dont know where zend log files are to see why the mysql daemon fails to start.

 725 pts.

 

If that is how you start MySQL, the log files should be in your MySQL data directory. I’m not aware of Zend changing the log file target when it starts MySQL. — Tom

 107,985 pts.

 

Problem solved. The problem was that a file ‘mysql.sh’ was missing in mysql/bin but i cant understand why zend didn’t create it during installation or mysql itself for that matter. It took us about 5 days to figure that out. I did find the log file but that didn’t give any error message. If only it had mentioned that ‘mysql.sh’ was missing it would have made it a lot easier. Thanks for your responses Tom.

 725 pts.

 

Any chance you can share how you discovered that obscure glitch? Sorry there weren’t any hints visible that I could help with. — Tom

 107,985 pts.

 

I came across a post in Zend forum which states that zend looks for /usr/local/mysq/bin/mysql.sh. However, when i checked we didn’t have it.http://forums.zend.com/viewtopic.php?f=77&t=6793 

 725 pts.