Bug #74214 my.cnf not read in default install location
Submitted: 3 Oct 2014 17:39 Modified: 29 Oct 2018 18:17
Reporter: peter teeson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:mysql-5.6.21-osx10.8-x86_64 OS:Mac OS X (Mountain Lion 10.8.5)
Assigned to: CPU Architecture:Any
Tags: datadir, my.cnf, option files

[3 Oct 2014 17:39] peter teeson
Description:
Default install from the mysql-5.6.21-osx10.8-x86_64.dmg installs my.cnf in /usr/local/mysql. 

However editing my.cnf to use a different datadir does not allow the Preference Pane to launch the server.

mysqld --verbose --help does not list my.cnf in the default location.

My solution was to mkdir /usr/local/mysql/etc (one of the dirs in the search hierarchy) and cp my.cnf to that dir.

The Preference Pane then launched the server.

How to repeat:
Default install and edit my.cnf datadir to a new location.
Launch via Preference Pane

Suggested fix:
My fix was to
mkdir /usr/local/mysql/etc and cp my.cnf to that dir.

I suggest that the distro for Mac OS X do this as part of the standard install.
(Most other searches I have done mention my.cnf being in some /etc dir)
[6 Oct 2014 18:03] Miguel Solorzano
Thank you for the bug report.

mysqld  Ver 5.6.21 for osx10.8 on x86_64 (MySQL Community Server (GPL))
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Starts the MySQL database server.

Usage: mysqld [OPTIONS]

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf

none of the above location worked for you?. Notice the above are the
default options. Thanks.
[6 Oct 2014 20:37] peter teeson
This is what I said when I filed the original post.
"My solution was to mkdir /usr/local/mysql/etc (one of the dirs in the
search hierarchy) and cp my.cnf to that dir."

So to answer your question, Yes one of the listed paths did work for me.

However if the .dmg installation had created that dir and placed the my.cnf there then, when I edited the my.cnf file to point datadir at a different location, there would have been no need for me to spend time figuring out what was wrong and file this bug.

So IMHO the install should be amended to do this....

thanks & respect...

Peter
[7 Oct 2014 20:03] Miguel Solorzano
Thank you for the feedback.
[22 Nov 2016 9:20] Vikram Jairam
I have just installed Server version: 5.7.16 MySQL Community Server (GPL) on Mac OS Sierra (Darwin MacPro201251 16.1.0 Darwin Kernel Version 16.1.0: Wed Oct 19 20:31:56 PDT 2016; root:xnu-3789.21.4~4/RELEASE_X86_64 x86_64)

So everything is working right. I am able to connect successfully. However, there is an issue. I cannot find a way to get the server to read my my.cnf. I placed a /etc/my.cnf, didn't work - the file was ignored. I changed settings and they did not apply. This is what I am using:

[mysqld]
long_query_time = 10
slow_query_log_file = /usr/local/mysql/data/MacPro201251-slowq.log
slow-query-log

Now I even tried to create a /usr/local/mysql/etc folder and putting the my.cnf there. That didn't work either.

I was however, able to successfully symlink the data folder to another mounted volume, and that symlink is working well. I would like to have a working my.cnf though, and any help in this matter will be much appreciated. Thank You.
[29 Oct 2018 18:17] Paul Dubois
Posted by developer:
 
Fixed in 8.0.11.

The preference pane included with the macOS installer now includes a
setting that enables specifying which my.cnf file the server should
read when started by launchd.