在安装完mysql后,用初始的密码登录,之后操作必须先修改密码。
登录进mysql后直接:set password = password('123456');
给出报错信息为: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 '123456';
希望能给你们解决!