问题原文
原帖链接 · user1066991 · CC BY-SA 3.0
On cPanel when I am logged in as root and type "mysql" without hostname and password it gives me direct access to mysql root user.
I would like to do this for one of my non-cpanel server where the linux root user gets password less logon to mysql root user in the same way as it does on cPanel.
Is this possible ?
已采纳解答
原帖链接 · user9517 · CC BY-SA 3.0
The easiest way to do this is to use a client section of the ~/.my.cnf file, and add the credentials there.
[client]
user=root
password=somepassword
...
it's a good idea to make that file readable only by root too.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
