在为Mysql修改密码时,遇到一个问题: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 '('root') where user='root'' at line 1

思考了一下,应该是密码修改的语法上出了点问题,
一开始尝试了就密码修改为数字123456:
update user set authentication_string=password('123456') where user='root';

还是报同样的错,
经过网上的搜索,原来是使用ALTER修改密码:
ALTER USER 'root'@'localhost'IDENTIFIED BY '123456';

在尝试为MySQL的root用户修改密码时遇到了ERROR1064的语法错误。首先使用UPDATE语句尝试修改失败,然后发现应使用ALTERUSER命令正确设置新密码,如:ALTERUSERroot@localhostIDENTIFIEDBY123456。
1万+

被折叠的 条评论
为什么被折叠?



