I have to log into multiple MYSQL DB's on different hosts via mysql cli. is it possible to save these logins so I don't have to trackdown/remember the credentials?
Based on a discussion at http://bugs.mysql.com/bug.php?id=17627 I use the following method to automatically log into different mysql servers:
[client] host="hostname1" user="username1" password="password1" database="database1"
[client] host="hostname2" user="username2" password="password2" database="database2"
Connect to host1, database1 with saved credentials above:
Connect to host2, database2 with saved credentials above:
Hope this helps :-)
You can always create an aliases to it
alias db1='mysql -uUsername1 -pPasswordSecure1 -hHosname1 DatabaseName1' alias db2='mysql -uUsername2 -pPasswordSecure2 -hHosname2 DatabaseName2'
And put them into your
But this doesn't solve the security issue! Even if you put "good" permission on your bash files it doesn't mean it isn't plain text :(