MySQL 8 修改root密码ERROR 1064 (42000): You have an error in your SQL syntax;

root先利用原密码登陆

bash 复制代码
mysql -u root -p
Enter password: *******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.26 MySQL Community Server - GPL

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

2.原修改方式syntx error

bash 复制代码
mysql> set password for root@localhost = password('xxxxx');
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('xxxxxx')' at line 1

3.MySQL 8对应修改方式,修改的是当前登陆用户的password

bash 复制代码
mysql> set password = 'yyyyyy';
Query OK, 0 rows affected (0.07 sec)

mysql>
相关推荐
叁沐1 小时前
MySQL 14 count(*)这么慢,我该怎么办?
mysql
长风破浪会有时呀2 小时前
Redis 命令总结
数据库·redis·缓存
灰小猿2 小时前
多级@JsonTypeInfo和@JsonSubTypes注解使用详解及场景分析
java·后端·mysql·spring·spring cloud
潇凝子潇2 小时前
MySQL 的 `EXPLAIN` 输出中,`filtered` 属性使用
android·数据库·mysql
lifallen2 小时前
Flink Exactly Once 和 幂等
java·大数据·数据结构·数据库·分布式·flink
木木子99992 小时前
SQL140 未完成率top50%用户近三个月答卷情况
数据库
泊浮目2 小时前
生产级Rust代码品鉴(二)RisingWave流作业提交到运行的流程-下
大数据·数据库
EutoCool3 小时前
Qt窗口:QToolBar、QStatusBar、QDockWidget、QDialog
开发语言·数据库·c++·嵌入式硬件·qt·前端框架
fengye2071613 小时前
板凳-------Mysql cookbook学习 (十一--------9)
android·学习·mysql
小王的饲养员3 小时前
Apipost 与 Apifox 数据库功能对比:深入解析与应用场景分析
大数据·数据库·人工智能·后端·postman