Bug #5029 mysql command to be able to use different configuration groups
Submitted: 13 Aug 2004 11:49 Modified: 27 Jun 2013 15:39
Reporter: alain williams Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:all OS:Any (all)
Assigned to: Matthew Lord CPU Architecture:Any

[13 Aug 2004 11:49] alain williams
Description:
I have different databases on different machines/passwords, etc.
I can have a default set up in .my.cnf in the [client] group and if I want to use something different change it with --host, etc.

It would be nice to be able to ask the client to use a different group so that I can keep the connection parms in the .my.cnf file, an option like '--group cluster2' would make it look at the [cluster2] group in .my.cnf.

Thanks for a great product.

How to repeat:
N/A
[16 May 2011 17:01] Valeriy Kravchuk
Thank you for the feature request.
[27 Jun 2013 15:39] Matthew Lord
Hi Alain,

Thank you for the feature request, and for helping to make MySQL even better!

I'm closing this feature request for now, as we do already have a way to achieve the same goal:
http://dev.mysql.com/doc/refman/5.6/en/option-file-options.html#option_general_defaults-gr...

matt$ cat ~/.my.cnf 
[client]
user=root
port=3357
socket=/tmp/mysql2.sock

[mysql_hname]
port=3306

matt$ mysql --defaults-group-suffix="_hname" --print-defaults
mysql would have been started with the following arguments:
--user=root --port=3357 --socket=/tmp/mysql2.sock --port=3306 

If you feel that there's any specific additional functionality that you'd still like to see added to the client, that wouldn't be covered by this, then just let me know.

Thanks again!