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>
相关推荐
2401_8331977321 分钟前
为你的Python脚本添加图形界面(GUI)
jvm·数据库·python
执笔画情ora33 分钟前
oracle数据库优化-表碎片优化性能。
数据库·oracle
givemeacar1 小时前
Spring Boot中集成MyBatis操作数据库详细教程
数据库·spring boot·mybatis
skiy1 小时前
MySQL Workbench菜单汉化为中文
android·数据库·mysql
IvorySQL1 小时前
PostgreSQL 技术日报 (3月24日)|当 MVCC 成本被重新审视
数据库·postgresql·开源
2401_895521341 小时前
PostgreSQL_安装部署
数据库·postgresql
创世宇图1 小时前
Alibaba Cloud Linux 安装生产环境-mysql
linux·mysql
Hvitur1 小时前
软考架构师【第六章】数据库设计基础知识
数据库·oracle
养生技术人1 小时前
Oracle OCP认证考试题目详解082系列第5题
运维·数据库·sql·oracle·开闭原则
2401_879693871 小时前
使用Python进行图像识别:CNN卷积神经网络实战
jvm·数据库·python