Bug #9834 mysqld_multi --config-file parameter requires absolute path
Submitted: 12 Apr 2005 2:23 Modified: 26 Apr 2005 14:35
Reporter: Lachlan Mulcahy Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.11 OS:Any (Any)
Assigned to: Jani Tolonen CPU Architecture:Any

[12 Apr 2005 2:23] Lachlan Mulcahy
Description:
The mysqld_multi script doesn't take into account the directory from which it is being executed when being passed the --config-file option. This can result in the incorrect file being used or none at all.

How to repeat:
Install mysql and add the bin dir to the path for your user.

Use this as your /etc/my.cnf:
[mysqld_multi]
mysqld = /usr/local/mysql/bin/mysqld_safe
mysqladmin = /usr/local/mysql/bin/mysqladmin
user = root

Create this file in your homedir as mymulti.cnf:
[mysqld1]
socket=/tmp/mysqld1.sock
port=33061
pid-file=/tmp/mysqld1.pid
datadir=/tmp/mysqld1/data
user=mysql
skip-innodb

Note: Ensure /tmp/mysqld1/data exists and is a valid default datadir.

Change directory to your home directory.
Run the following:

sudo mysqld_multi --config-file=mymulti.cnf start 1

You should get something like:

050412 12:19:04 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql-standard-4.1.11-apple-darwin7.8.0-powerpc/data/ is case insensitive
050412 12:19:04 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

050412 12:19:04 [ERROR] Aborting

050412 12:19:04 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

Whereas using this command works fine:

sudo mysqld_multi --config-file=`pwd`/mymulti.cnf start 1

Yet this command fails:

sudo mysqld_multi --config-file=<nonexistant file> start 1

with:

Option file '<filename>' doesn't exists, or is not readable.

It looks like the script is testing for the existance of the config file correctly, yet when it tries to actually read it in it's forgetting about the current working dir.

Suggested fix:
None.
[26 Apr 2005 14:35] Jani Tolonen
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Fixed into 5.0.
[26 Apr 2005 14:37] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24318