【ERROR 1064 (42000)】MySQL中使用mysqladmin或set修改root密码时提示语法错误
2024-10-20 01:23:17
报错信息:
mysql> mysqladmin -uroot -p123456 password 654321;
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 'mysqladmin -uroot -p123456 password 654321' at line 1
mysql> set password for root@localhost = password('654321');
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('654321')' at line 1
报错原因:
新版本MySQL(8.0以上)不支持使用mysqladmin -uroot -p123456 password 654321;
或“set password for root@localhost = password('654321');”
来修改密码。
解决方法:
alter user'root'@'localhost' identified by '新密码';
- 或
alter user'root'@'localhost' identified with mysql_native_password by '新密码';
最新文章
- mysql 常用自定义函数解析
- 【java】:通用接口
- Android显示等宽图片的问题
- python 中颜色的表示
- (转)使用pth文件,让python方便的import自己写的模块
- jwt (JSON Web Token)官方说明
- Kmeans聚类算法
- Yii2设计模式——简单工厂模式
- VMware虚拟机共享宿主机硬盘步骤
- ELK+Filebeat+Kafka+ZooKeeper 构建海量日志分析平台(elk5.2+filebeat2.11)
- 快速掌握JavaScript面试基础知识(二)
- vue自定义一个v-model
- 用反向代理nginx proxy_pass配置解决ie8 ajax请求被拦截问题 ie8用nginx代理实现跨域请求访问 nginx405正向代理request_uri
- python爬虫——对爬到的数据进行清洗的一些姿势(5)
- 日期条控件 DateFieldControl
- [LISP] LISP Collections
- docker——三剑客之Docker swarm
- BZOJ2208:[JSOI2010]连通数——题解
- LUOGU 1440
- GNU Readline 库及编程简介【转】
热门文章
- 整理汇总系统中空值的使用方法,后台+jsp
- TreeMap简介
- PLC常见四大故障及其处理方法
- 吴裕雄--天生自然 python开发学习笔记:一劳永逸解决绘图出现中文乱码问题方法
- Python---8函数(函数的参数&;递归函数)
- Java发送Post请求,参数JSON,接收JSON
- Caused by: com.alibaba.fastjson.JSONException: syntax error, expect {, actual [, pos 0, fastjson-version 1.2
- OCR:慧眼读世界
- 有用户及目录判断的删除文件内容的Shell脚本
- c#数据库解析