当前位置:网站首页>报错:Client does not support authentication protocol requested by server; consider upgrading MySQL cli
报错:Client does not support authentication protocol requested by server; consider upgrading MySQL cli
2022-08-10 23:48:00 【不能懒鸭】
连接mysql数据库时报错:
原因:mysql版本问题。
mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password,所以可以需要改变mysql的加密规则
1. 打开cmd窗口,登录mysql;mysql -u root -h 127.0.0.1 -P3306 -p
- -u
后面root 为自己数据库的用户名
- -h
后面为 (mysql服务所在地址),我自己是在本机测试,所以为127.0.0.1
- -P
(可选,默认3306 指定端口号)
会提示输入密码,输入自己数据库的密码,可以看到版本信息,则登录成功;
2. 查看现有的用户
也可以输入命令再次查看版本 select version();
查看现有的用户 SELECT user,host,plugin from mysql.user;
3. 设置加密方式ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你自己的密码';
4. 让设置生效FLUSH PRIVILEGES;
5. 查看设置是否成功
SELECT user,host,plugin from mysql.user;
边栏推荐
- Server Tips
- 只会懒汉式和饿汉式 你还不懂单例模式!
- Timers, synchronous and asynchronous APIs, file system modules, file streams
- Google Chrome73~81版本浏览器的跨域问题解决方案
- I caught a 10-year-old Ali test developer, and after talking about it, I made a lot of money...
- 逮到一个阿里 10 年老 测试开发,聊过之后收益良多...
- 开启新征程——枫叶先生第一篇博客
- Geogebra 教程之 03 没有铅笔的数学
- oai 采样频率计算
- Summary of Confused Knowledge Points for "High Items" in the Soft Examination in the Second Half of 2022 (2)
猜你喜欢
进程和线程
Dump file generation, content, and analysis
工程师如何对待开源
15. 拦截器-HandlerInterceptor
15. Interceptor - HandlerInterceptor
How to recover deleted files from the recycle bin, two methods of recovering files from the recycle bin
Design and Realization of Employment Management System in Colleges and Universities
烘干衣服问题
Web APIs BOM- 操作浏览器之综合案例
[C Language Chapter] Detailed explanation of bitwise operators (“<<”, “>>”, “&”, “|”, “^”, “~”)
随机推荐
App的回归测试,有什么高效的测试方法?
IEEE的论文哪里可以下载?
缓存知识总结
电脑桌面删除的文件回收站没有,电脑上桌面删除文件在回收站找不到怎么办
SAS数据处理技术(一)
15. 拦截器-HandlerInterceptor
How to determine how many bases a number is?
“蔚来杯“2022牛客暑期多校训练营3 DF题解
【C语言】数据储存详解
Why do programming languages have the concept of variable types?
“蔚来杯“2022牛客暑期多校训练营2 DGHJKL题解
SAS data processing technology (1)
线上突然查询变慢怎么核查
15. Interceptor - HandlerInterceptor
工程师如何对待开源
推进牛仔服装的高质量发展
Summary of Confused Knowledge Points for "High Items" in the Soft Examination in the Second Half of 2022 (2)
基于SSM实现手机销售商城系统
Is there a way out in the testing industry if it is purely business testing?
编程语言为什么有变量类型这个概念?