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>
相关推荐
Hx__15 分钟前
Redis对象编码
数据库·redis·缓存
运维帮手大橙子2 小时前
完整的登陆学生管理系统(配置数据库)
java·前端·数据库·eclipse·intellij-idea
0wioiw02 小时前
Redis(④-消息队列削峰)
数据库·redis·缓存
Runing_WoNiu2 小时前
Mysql与Ooracle 索引失效场景对比
数据库·mysql·oracle
beijingliushao2 小时前
32-Hive SQL DML语法之查询数据
数据库·hive·sql
JIngJaneIL3 小时前
专利服务系统平台|个人专利服务系统|基于java和小程序的专利服务系统设计与实现(源码+数据库+文档)
java·数据库·小程序·论文·毕设·专利服务系统平台
__风__3 小时前
windows 上编译PostgreSQL
数据库·postgresql
木木子99994 小时前
数据库范式
数据库
涛思数据(TDengine)4 小时前
通过最严时序标准,再登产业图谱榜首,TDengine 时序数据库在可信数据库大会荣获双荣誉
大数据·数据库·时序数据库·tdengine·涛思数据
涛思数据(TDengine)4 小时前
新客户 | TDengine 时序数据库是怎么在钢厂“撬动”PI 的?
大数据·运维·数据库·时序数据库·tdengine