Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#19075 - [mysql] initscript defeats custom database location

Attached to Project: Arch Linux
Opened by Nicklas Overgaard (nicklas) - Tuesday, 13 April 2010, 09:00 GMT
Last edited by Andrea Scarpino (BaSh) - Tuesday, 13 April 2010, 10:47 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Andrea Scarpino (BaSh)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
In MySQL, if you want to have your databases located in another directory than "/var/lib/mysql" you can change the datadir in my.cnf.

However, the rc.d iniscript for mysqld, executes "mysqld_safe --datadir=$MYSQLD_ROOT" where $MYSQLD_ROOT is the default directory. This actually overrides the definitions made in the my.cnf file, making it impossible to move the directory.

I had changed the script on a production mysql server (removed the --datadir directive), but with the most recent update of mysql, pacman relentlessly replaced the rc.d file - leaving MySQL unable to start (!)

I have attached a patch for the rc.d file, which you can apply to fix the issue.

Additional info:
Version: mysql 5.1.45-1

It was during (or should i say after) the update from the previous version (i don't remember the version number) to the above, that the problem occurred.


Steps to reproduce:
* Stop mysql
* Change the "datadir" in my.cnf to something else than the default
* move your datadir directory to the new location.
* Make sure that it is properly owned by mysql
* Try to start mysql.. it will now fail.

Now apply the patch to the rc.d file and try again. MySql should start correctly now.
This task depends upon

Closed by  Andrea Scarpino (BaSh)
Tuesday, 13 April 2010, 10:47 GMT
Reason for closing:  Implemented
Additional comments about closing:  see comments
Comment by Andrea Scarpino (BaSh) - Tuesday, 13 April 2010, 09:31 GMT
did you set MYSQL_ROOT into /etc/conf.d/mysqld?
Comment by Nicklas Overgaard (nicklas) - Tuesday, 13 April 2010, 09:47 GMT
Nope, I was not aware of that - but after reading through the rc.d file again, i see things more clearly :)

However, would'nt it be more clean to actually define this in the my.cnf file? And then just enter the default value which is used now?
Comment by Andrea Scarpino (BaSh) - Tuesday, 13 April 2010, 10:47 GMT
well...seems that mysqld_safe does not need any parameter.
I committed on trunk a new mysqld that does not need conf.d/mysql

Loading...