Specifying location of .my.cnf to load_defaults
Since a search on the MySQL website doesn't yield any returns for load_defaults() - in fact it splits it into Load and defaults and doesn't search for it directly - and none of the MySQL documentation covers this function, does anybody know how to specify and alternate location for the .my.cnf file (defaults to $HOME/.my.cnf). Kevin Cowley RD Tel: 0118 902 9099 (direct line) Email: [EMAIL PROTECTED] Web: http://www.alchemetrics.co.uk ** ALCHEMETRICS LIMITED (ALCHEMETRICS) Mulberry Park, Fishponds Road, Wokingham, Berkshire, RG41 2GX Tel: +44 (0) 118 902 9000Fax: +44 (0) 118 902 9001 This e-mail is confidential and is intended for the use of the addressee only. If you are not the intended recipient, you are hereby notified that you must not use, copy, disclose, otherwise disseminate or take any action based on this e-mail or any information herein. If you receive this transmission in error, please notify the sender immediately by reply e-mail or by using the contact details above and then delete this e-mail. Please note that e-mail may be susceptible to data corruption, interception and unauthorised amendment. Alchemetrics does not accept any liability for any such corruption, interception, amendment or the consequences thereof. **
Re: Specifying location of .my.cnf to load_defaults
From: Kevin Cowley Since a search on the MySQL website doesn't yield any returns for load_defaults() - in fact it splits it into Load and defaults and doesn't search for it directly - and none of the MySQL documentation covers this function, does anybody know how to specify and alternate location for the .my.cnf file (defaults to $HOME/.my.cnf). I think you'll find the info at http://dev.mysql.com/doc/mysql/en/Option_files.html Regards, Jigal. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Specifying location of .my.cnf to load_defaults
Thanks for the response but I already knew about that page. The problem is with a client application it doesn't know anything about how the server is configured and it doesn't matter. Basically it's a case of doing main(int argc, char **argv) { my_init(); load_defaults(); handle_options(); } So you need to be able to tell load_defaults where to locate the .my.cnf file so it can go and load the defaults. Kevin Cowley RD Tel: 0118 902 9099 (direct line) Email: [EMAIL PROTECTED] Web: http://www.alchemetrics.co.uk -Original Message- From: Jigal van Hemert [mailto:[EMAIL PROTECTED] Sent: 12 January 2005 12:26 To: Kevin Cowley; mysql@lists.mysql.com Subject: Re: Specifying location of .my.cnf to load_defaults From: Kevin Cowley Since a search on the MySQL website doesn't yield any returns for load_defaults() - in fact it splits it into Load and defaults and doesn't search for it directly - and none of the MySQL documentation covers this function, does anybody know how to specify and alternate location for the .my.cnf file (defaults to $HOME/.my.cnf). I think you'll find the info at http://dev.mysql.com/doc/mysql/en/Option_files.html Regards, Jigal. ** ALCHEMETRICS LIMITED (ALCHEMETRICS) Mulberry Park, Fishponds Road, Wokingham, Berkshire, RG41 2GX Tel: +44 (0) 118 902 9000Fax: +44 (0) 118 902 9001 This e-mail is confidential and is intended for the use of the addressee only. If you are not the intended recipient, you are hereby notified that you must not use, copy, disclose, otherwise disseminate or take any action based on this e-mail or any information herein. If you receive this transmission in error, please notify the sender immediately by reply e-mail or by using the contact details above and then delete this e-mail. Please note that e-mail may be susceptible to data corruption, interception and unauthorised amendment. Alchemetrics does not accept any liability for any such corruption, interception, amendment or the consequences thereof. ** -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Specifying location of .my.cnf to load_defaults
Kevin Cowley [mailto:[EMAIL PROTECTED] wrote: Thanks for the response but I already knew about that page. The problem is with a client application it doesn't know anything about how the server is configured and it doesn't matter. Basically it's a case of doing main(int argc, char **argv) { my_init(); load_defaults(); handle_options(); } So you need to be able to tell load_defaults where to locate the .my.cnf file so it can go and load the defaults. Are you on a *ix system? You might try something like this, assuming that you know the name of the script that starts the mysql daemon at boot time: #!/bin/sh mysqld=/etc/init.d/mysqld realmysqlserver=`awk '$2 == start {print $1;exit}' $mysqld` mydotconf=`grep '^[ ]*conf=' $realmysqlserver | sed 's/^.*=//'` mysqldatadir=`grep '^[ ]*datadir=' $realmysqlserver | sed 's/^.*=//'` As you might guess, I use a technique like this to locate the MySQL data directory in scripts I run overnight to check the databases and manage backups. Steve Bacher System Administrator Draper Laboratory [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Specifying location of .my.cnf to load_defaults
Steve Yes I am on a *ix system but this has nothing to do with the server startup or configuration. This is how to tell a client application where it can locate a .my.cnf file not the system my.cnf file for the database itself. The purpose of the .my.cnf file is to allow the client to know which database/server/port/user/password to use when connecting. By default it looks for it in $HOME. The problem is if you've got 5 ordinary users but you only want one .my.cnf file then you need to be able to tell the client app where the file is - I can do this with a command line parameter. The problem I have is how do I tell the MySQL client library, ie the load_defaults function where it is as there's no parameter to do this. Kevin Cowley RD Tel: 0118 902 9099 (direct line) Email: [EMAIL PROTECTED] Web: http://www.alchemetrics.co.uk -Original Message- From: Steve Bacher [mailto:[EMAIL PROTECTED] Sent: 12 January 2005 17:55 To: mysql@lists.mysql.com Subject: RE: Specifying location of .my.cnf to load_defaults Kevin Cowley [mailto:[EMAIL PROTECTED] wrote: Thanks for the response but I already knew about that page. The problem is with a client application it doesn't know anything about how the server is configured and it doesn't matter. Basically it's a case of doing main(int argc, char **argv) { my_init(); load_defaults(); handle_options(); } So you need to be able to tell load_defaults where to locate the .my.cnf file so it can go and load the defaults. Are you on a *ix system? ** ALCHEMETRICS LIMITED (ALCHEMETRICS) Mulberry Park, Fishponds Road, Wokingham, Berkshire, RG41 2GX Tel: +44 (0) 118 902 9000Fax: +44 (0) 118 902 9001 This e-mail is confidential and is intended for the use of the addressee only. If you are not the intended recipient, you are hereby notified that you must not use, copy, disclose, otherwise disseminate or take any action based on this e-mail or any information herein. If you receive this transmission in error, please notify the sender immediately by reply e-mail or by using the contact details above and then delete this e-mail. Please note that e-mail may be susceptible to data corruption, interception and unauthorised amendment. Alchemetrics does not accept any liability for any such corruption, interception, amendment or the consequences thereof. ** -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]