gpt4 book ai didi

mysql .my.cnf 没有正确读取凭据?

转载 作者:可可西里 更新时间:2023-11-01 06:43:50 26 4
gpt4 key购买 nike

我可以使用以下行连接到 mysql:

mysql -u myusername -p
(enters password into terminal)
>>>Welcome to the MySQL monitor. Commands end with ; or \g.
>>>Your MySQL connection id is 51
>>>Server version: 5.6.10-log Source distribution

这是我的主目录中的 .my.cnf(不是/etc/my.cnf):

[client]
user = myusername
password = mypassword
host = localhost

我的/etc/my.cnf 中似乎也有一个客户端部分:

# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock

然而,当我在终端中输入“mysql”时,我得到:

ERROR 1045 (28000): Access denied for user 'myusername'@'localhost' (using password: YES)

我的 my.cnf 有什么问题?

此外,它与此处提到的匿名用户无关:MySQL ERROR 1045 (28000): Access denied for user 'bill'@'localhost' (using password: YES)

这是建议查询的结果:

>>>mysql --print-defaults
>>>mysql would have been started with the following arguments:
>>>--port=3306 --socket=/tmp/mysql.sock --no-auto-rehash --user=myusername --password=mypassword --host=localhost

最佳答案

正如@Wrikken 在评论中所说,如果您引用密码并且密码包含诸如 =; 之类的字符,它将起作用。

关于mysql .my.cnf 没有正确读取凭据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19300501/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com