安装MYSQL解压版初始化后改密码报错误解决命名

mysql> set password for [email protected] = password(`123`);
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(`123`)' at line 1
mysql> update user set authentication_string=password("123") 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 '("123") where user="root"' at line 1
mysql> update user set authentication_string=password('123') 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 '('123') where user='root'' at line 1

安装MYSQL解压版初始化后改密码报错误解决命名

解决方法:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123';

Query OK, 0 rows affected (0.17 sec)