gpt4 book ai didi

Mysql修改密码时出现错误1064

转载 作者:行者123 更新时间:2023-11-29 17:13:24 27 4
gpt4 key购买 nike

尝试按照 this 中给出的步骤更改 mysql 密码时解决方案,我收到以下错误 -

mysql> UPDATE mysql.user SET authentication_string = PASSWORD('letsrock') WHERE User = 'root' AND Host = 'localhost';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('letsrock') WHERE User = 'root' AND Host = 'localhost'' at line 1

mysql 中有更新命令的新语法吗?我使用的是8.0.12版本。

最佳答案

“user”和“host”都是保留字,如果不使用反引号括起来,就不能用作标识符。就像这样:

UPDATE mysql.user 
SET authentication_string = PASSWORD('letsrock')
WHERE `User` = 'root' AND `Host` = 'localhost';

参见:https://dev.mysql.com/doc/refman/8.0/en/keywords.html

关于Mysql修改密码时出现错误1064,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51765997/

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