我忘记了mysql的密码,所以我尝试使用以下步骤更改它:
1)停止Mysql服务器
2)使用sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables在安全模式下启动服务器
3)使用sudo /usr/local/mysql/bin/mysql -u root打开mysql命令行
4)使用UPDATE mysql.user SET authentication_string=PASSWORD('NewPassword') WHERE User='root';更新密码
但在这一步中,我得到了以下错误消息-
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 '('NewPassword') WHERE User='root'' at line 1有人能告诉我如何解决这个错误吗?
https://stackoverflow.com/questions/51396981
复制相似问题