Cannot make mysql client read the password form .mylogin.cnf
Hello,
I'm trying to make mysql client on linux connect to a mysql server without requiring the password to be given interactively. Steps taken:
1) First create a mylogin.cnf file
$ mysql_config_editor set --user=<user> --password --host=<host>
Enter password:
2) File created successfully:
$ ls -la .mylogin.cnf
-rw-------. 1 urmt urmt 136 Dec 19 11:01 .mylogin.cnf
$ mysql_config_editor print --all
[client]
user = <user>
password = *****
host = <host>
3) Connect using mysql client
$ mysql <dbname>
ERROR 1045 (28000): Access denied for user '<user>'@'<host>' (using password: NO)
Is there a default value/configuration somewhere that makes the client ignore the password in mylogin.cnf? The user and host properties were read correctly from the file.
I am able to connect just fine if I provide the password on the command line:
$ mysql -p <dbname>
Enter password:
Reading table information...
...
mysql>
I get the same behavior if I define login path.
I get the same behavior if I define a clear-text file ~/.my.cnf and set the user, database, host and password there.
MySQL client version is 5.6.22, MySQL Server version is 5.6.22, both on Oracle Linux 6. Client and server are on different hosts.
Thanks
Subject
Views
Written By
Posted
Cannot make mysql client read the password form .mylogin.cnf
5183
February 03, 2015 03:44AM
1747
April 10, 2015 04:50PM
1603
April 14, 2015 12:14AM
2597
April 14, 2015 09:33AM
1598
April 23, 2015 12:16AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.