Bug #11075 /usr/local/mysql/data/my.cnf location unchanged by datadir
Submitted: 3 Jun 2005 14:17 Modified: 3 Jun 2005 15:33
Reporter: Mark Johnson (Basic Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.6 OS:
Assigned to: CPU Architecture:Any

[3 Jun 2005 14:17] Mark Johnson
I am using a nonstandard location for my data directory.  However, mysqld continues to search the standard location for the required my.cnf file.  This causes it to fail to start.

How to repeat:
Here is my /etc/my.cnf file:
mj@enterprise:/usr/local/mysql/bin$ cat /etc/my.cnf


I have also modified the mysql.server script to hard-code my datadir as it does not pick up my change from the /etc/my.cnf file.

Here is the output from "mysqld --print-defaults":
./mysqld would have been started with the following arguments:
--datadir=/mnt/raid/mysqldata --user=mysql --port=3306 --socket=/tmp/mysql.sock

Here is the error in my log file:
050603 08:00:14  mysqld started
Could not open required defaults file: /usr/local/mysql/data/my.cnf
Fatal error in defaults handling. Program aborted
050603 08:00:14  mysqld ended

Suggested fix:
When the data directory is changed, the location searched for the required my.cnf file should be changed as well.
[3 Jun 2005 14:20] Mark Johnson
I followed the workaround in bug #10940 and did the following:
# touch /usr/local/mysql/data/my.cnf
# chgrp mysql /usr/local/mysql/data/my.cnf

This has permitted mysqld to start.
[3 Jun 2005 15:33] Sergei Golubchik
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in MySQL.

Additional info: