首页 > 技术文章 > Mac下mysql修改root密码

eisenshu 2021-12-31 17:24 原文

用很多种办法始终不行,总是出现:

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

亲测用以下方法有效:

alter user 'root'@'localhost' identified by '新密码';

 

推荐阅读