重新装电脑后 忘记MySQL8.0如何修改密码 网上百度到
set password for root@localhost = password('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 'password('root')' at line 1
应当是使用的语句不对
更改使用
alter user 'root'@'localhost' identified by 'root';
修改成功