Authentication method 'caching_sha2_password' not supported by any of the available plugins.
2019独角兽企业重金招聘Python工程师标准>>>
这是MySQL8.0一个登录验证的问题。
第一步 初始化配置
如果已经初始化了,就直接跳过第一步
你需要知道的是:MySQL安装的路径。我的路径是:G:\mysql-8.0.11-winx64
在C:\Windows\System32路径下找到cmd.exe,右键以管理员身份运行,并切换到mysql-8.0.11-winx64中。
输入命令初始化data目录:
mysqld --initialize --console 会出现一段内容,找到内容中root@localhost: 它后面就是登录数据库的初始密码,一定要记下来
再输入命令初始化mysql服务
mysqld --install 然后输入命令启动mysql
net start mysql 如果已经启动了,他会提示你服务已经启动。
如果提示拒绝访问,那你肯定没有以管理员身份运行cmd。在C:\Windows\System32路径下找到cmd.exe,右键以管理员身份运行。继续上步操作。
接下来,登录到数据库
mysql -u root -p 密码:输入就是刚才记下来的,
登陆成功后接着更改密码,输入
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';
这以上只是确保不会出现其他的问题,还不能解决密码验证的问题。
第二步 修改MySQL的登录验证配置
cmd连接mysql
mysql -u root -p 修改加密规则
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; 更新一下用户的密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; 刷新权限
FLUSH PRIVILEGES; 重置下密码(123456789这里是你要设置的密码)
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456789'; 完成以后,试着重新连接mysql数据库,如果还没有成功,继续往下走:
第三步 根目录增加配置文件
在mysql-8.0.11-winx64这个目录下,新建my.ini文件,文件内容如下,记得保存:
[mysqld]
默认使用“mysql_native_password”插件认证
default_authentication_plugin=mysql_native_password [mysql]
设置mysql客户端默认字符集
default-character-set=utf8 [client]
设置mysql客户端连接服务端时默认使用的端口
port=3306 default-character-set=utf8
默认使用“mysql_native_password”插件认证
default_authentication_plugin=mysql_native_password [mysql]
设置mysql客户端默认字符集
default-character-set=utf8 [client]
设置mysql客户端连接服务端时默认使用的端口
port=3306 default-character-set=utf8 接下来需要重启mysql服务。
先停止mysql服务,
net stop mysql 如果提示拒绝访问,那你肯定没有以管理员身份运行cmd。在C:\Windows\System32路径下找到cmd.exe,右键以管理员身份运行。继续上步操作。
已停止成功后,继续输入命令启动mysql
net start mysql 查看是不是可以正常启动
如果无法启动,就是那个my.ini文件的问题,尝试只保留文件中的一部分
[mysqld]
默认使用“mysql_native_password”插件认证
default_authentication_plugin=mysql_native_password 继续启动mysql。
启动成功后,就说明修改配置文件成功,尝试去连接数据库,应该就成功了
转载于:https://my.oschina.net/u/2446847/blog/3026053
Authentication method 'caching_sha2_password' not supported by any of the available plugins.相关推荐
- Authentication method ‘caching_sha2_password‘ not supported by any of the available plugins.
这是MySQL8.0一个登录验证的问题. 第一步 初始化配置 如果已经初始化了,就直接跳过第一步 你需要知道的是:MySQL安装的路径.我的路径是:G:\mysql-8.0.11-winx64 在C: ...
- navicat连接pgsql报错:authentication method 10 not supported
navicat连接pgsql报错:authentication method 10 not supported 解决方案:找到pgsql的安装目录下的pg_hba.conf文件 用文本编辑器打开后做如 ...
- PostgreSQL使用Navicat连接pgsql时出现authentication method 10 not supported的解决办法
解决办法 修改pgsql的安装目录下的pg_hba.conf文件 # TYPE DATABASE USER ADDRESS METHOD# "local" is for Unix ...
- navicat连接postgresql时报错:authentication method 10 not supported
修改配置文件: C:\postgreSQL\9.5\data\pg_hba.conf #"local" is for Unix domain socket connections ...
- SQLAlchemy 报错 NotSupportedError: Authentication plugin ‘caching_sha2_password’ is not supported 解决方法
报错内容 在使用 python SQLAlchemy 连接数据库时,遇到以下错误: NotSupportedError: Authentication plugin 'caching_sha2_pas ...
- 【纠错】——mysql Authentication plugin ‘caching_sha2_password‘ is not supported问题处理
mysql Authentication plugin 'caching_sha2_password' is not supported问题处理 使用mysql8.0版本,登录失败,提示 Authen ...
- no supported authentication method异常
修改TortoiseGit 或者 git 路径 或者公钥密钥路径,异常:no supported authentication method 修改方法: 首先找到项目 项目右键 TortoiseGit ...
- golang连接mysql报错:this authentication plugin is not supported 解决方案
MySQL升级8.0以上版本后,在用第三方库github.com/Go-SQL-Driver/MySQL打开数据库时会报错this authentication plugin is not suppo ...
- mysql错误:this authentication plugin is not supported
this authentication plugin is not supported 应用程序连接mysql docker一直报错:this authentication plugin is not ...
最新文章
- Centos6安装SaltStack
- SQL Server 2008企业试用版到期,升级为企业版
- 嵌入式编程C语言提高代码效率的14种方法
- 计算 java_两种计算Java对象大小的方法(转)
- java设计模式face_java设计模式之-------原型模式
- 阿里云Kubernetes SpringCloud 实践进行时(5): 弹性服务与容错处理
- sql中in与=的异同
- DropDownList下拉框多选
- Java坦克大战Summary
- Paragon ntfs2022轻松让mac读写NTFS格式磁盘移动硬盘U盘
- C# amr转mp3 (ffmpeg)
- 16万大奖,名企offer,翼支付杯大数据建模大赛邀你来战!
- 前端技术教学第一周 10.15
- 【转载】如何从win8/8.1中文版(核心版)升级到win8/8.1专业版
- 【jQuery】一个动画的例子
- FSCIL 小样本类增量学习
- go语言中error的分类与用法
- 网络游戏开发之安全对抗
- ubuntu制作私有源
- 腾讯笔试题_20220424
热门文章
- 360p4虚拟服务器,360安全路由p4c常见的问题以及解决方法介绍
- centos linux引导修复_CentOS没了,Linux的新世界来了
- android 对比win10 耗电,win10系统下像何查看耗电的应用程序
- 调用vba_Python VS JavaScript,谁将是替代VBA最好语言
- 长短期记忆网络_昆明理工大学刘可真、苟家萁、骆钊等:粒子群优化长短期记忆网络模型如何进一步提高变压器油中溶解气体浓度的精准预测?...
- 计算机网络 物理层链路层
- FPGA之道(28)VHDL的并行语句
- FPGA从Xilinx的7系列学起(4)
- 谈谈 Mifare Classic 破解
- RHEL7 kvm虚拟机桥接网络配置