Bug #76124 Add option to set default loginpath
Submitted: 3 Mar 2015 12:21 Modified: 17 Jul 2015 13:26
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:5.7 OS:Any
Assigned to: Georgi Kodinov CPU Architecture:Any
Tags: login, loginpath, path

[3 Mar 2015 12:21] Daniël van Eeden
Description:
There is no option I can use to set the default login path. I could use 'client' as login path, but I would like to be able to use a more appropriate name like prod, local55 or dev08.

How to repeat:
Create a login path named 'local57':
mysql_config_editor set --login-path=local57 --user=msandbox -p

Now try to set it as default:
cat > ~/.my.cnf << EOF
[client]
login-path="local57"

[mysql]
prompt="mysql [\d] > "
EOF
mysql
[17 Jul 2015 13:26] Georgi Kodinov
Thank you for your reasonable feature request.

One possible workaround is to use suffixes, e.g:

d:\ade\git\mysql-5.7\bld\mysql-test>..\client\Debug\mysql_config_editor.exe set --login-path=client.suf --host=foo --user=bar

d:\ade\git\mysql-5.7\bld\mysql-test>..\client\Debug\mysql_config_editor.exe print --all
[client.suf]
user = bar
host = foo

d:\ade\git\mysql-5.7\bld\mysql-test>..\client\Debug\mysql --defaults-group-suffix=.suf
ERROR 2005 (HY000): Unknown MySQL server host 'foo' (2)