起因:
最近在我安装最新版MySQL8.0.31数据库时,在进行密码的修改时,发现用以往的set password的方式执行不了。
显示报错: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 ‘password(‘123456’)’ at line 1
我刚开始还以为是我输入错了的问题,检查了单词也检查了标点符号,多次试后还是无果,后来找到了这位大佬的文章: https://blog.csdn.net/qq_45737300/article/details/127344953
,心结终于解开了!
解决办法:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
具体执行结果见下图:
结束语:
犯错督我成长,解错让我前行!