MySQL Forums
Forum List  »  Security

Using passwordless option file with mysql client
Posted by: Benny Pei
Date: January 17, 2017 04:26PM

Hi all,

I am trying to setup password-less option file to a remote database. I created a option file like this.

---
$ cat c.conf
[client]
user=root
password=password
database=mysql
host=dbhost1
---

It works successfully using this on the command line and I am connected to a remote host.
$ mysql --defaults-extra-file=./c.conf --silent
mysql>


However if I add multiple entries in the same file, it failed to login.

---
$ cat c.conf
[c1]
user=root
password=password
database=mysql
host=dbhost1

[c2]
user=root
password=password
database=mysql
host=dbhost2

$ mysql --defaults-extra-file=./c.conf --silent --login-path=c1
ERROR 1045 (28000): Access denied for user
====

Could someone tell me what I have done wrong?

thanks,


benny

Options: ReplyQuote


Subject
Views
Written By
Posted
Using passwordless option file with mysql client
1807
January 17, 2017 04:26PM


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.