Bug 131814

Summary: customizable my.cnf filename for databases/mysql51-server
Product: Ports & Packages Reporter: Carsten Wiedmann <carsten_sttgt>
Component: Individual Port(s)Assignee: Alex Dupre <ale>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Carsten Wiedmann 2009-02-18 13:50:01 UTC
As of MySQL 5.1.10 the location for the "my.cnf" should be "/usr/local/etc" [1]. But in the startup script "/mysql-server.sh" the path is fixed to "--defaults-extra-file=${mysql_dbdir}/my.cnf".

a) the default should be "/usr/local/etc/my.cnf".
b) there should be a rc.conf var like " ${mysql_defaultsfile="/usr/local/etc/my.cnf"}".

Regards,
Carsten

[1] http://dev.mysql.com/doc/refman/5.1/en/option-files.html#id657775
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2009-02-18 13:50:12 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Alex Dupre freebsd_committer freebsd_triage 2009-02-25 09:19:34 UTC
State Changed
From-To: open->closed

It's already so.
Comment 3 Carsten Wiedmann 2009-02-25 09:41:05 UTC
Hi Alex,

> State-Changed-Why: It's already so.

definitive not... Just look at [1] (Rev.1.6 from 2008-07-30).

There you can found:
| command_args="--defaults-extra-file=${mysql_dbdir}/my.cnf \
| --user=${mysql_user} --datadir=${mysql_dbdir} \
| --pid-file=${pidfile} ${mysql_args} > /dev/null 2>&1 &"

As you can see, "defaults-extra-file" is fixed to "${mysql_dbdir}/my.cnf".
And "${mysql_dbdir}" is normally "/var/db/mysql" (the directory with the
databases/tables).
--> /var/db/mysql/my.cnf

As you can read in the MySQL docu [2], the file should be in e.g.:
--> /usr/local/etc/my.cnf

After thinking about, I think you should not set a default for
defaults-extra-file, because mysqld_safe searches for "my.cnf" in various
locations it self. And so the rc script can work, regardless if the file is
in /var/db/mysql or /usr/local/etc/.
Only if the user defines a defaults file in rc.cnf, set this parameter for
the MySQL start.

Regards,
Carsten Wiedmann


[1]
http://www.freebsd.org/cgi/cvsweb.cgi/ports/databases/mysql51-server/files/mysql-server.sh.in?rev=1.6;content-type=text%2Fplain

[2] http://dev.mysql.com/doc/refman/5.1/en/option-files.html#id657775