利用mysql -u root 进入数据库后
1、use mysql;
update user set authentication_string='' where user='root'
2、ALTER user 'root'@'localhost' IDENTIFIED BY 'Cliu123#'
3、之前使用SET PASSWORD FOR root@localhost = password('123456');总是会报错
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