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.
来源: MySql.Data
实例:    在 MySql.Data.MySqlClient.Authentication.AuthenticationPluginManager.GetPlugin(String method)
   在 MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.GetPlugin(String method, NativeDriver driver, Byte[] authData)
   在 MySql.Data.MySqlClient.NativeDriver.Authenticate(String authMethod, Boolean reset)
   在 MySql.Data.MySqlClient.NativeDriver.Open()
   在 MySql.Data.MySqlClient.Driver.Open()
   在 MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
   在 MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
   在 MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
   在 MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
   在 MySql.Data.MySqlClient.MySqlPool.GetConnection()
   在 MySql.Data.MySqlClient.MySqlConnection.Open()
   在 MySql.Data.MySqlClient.MySqlProviderServices.GetDbProviderManifestToken(DbConnection connection)
   在 System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection)

解法:

   在因之前是mysql5.7,现换成mysql8,8的登陆加密规则与5.7的不一样,导致用户验证方法通过,所以有上面异常。以在mysql8的服务器上,到C:\ProgramData\MySQL\MySQL Server 8.0目录下,找到my.ini文件,在# The default authentication plugin to be used when connecting to the server的下面加default_authentication_plugin=mysql_native_password设置,8的验证方法是caching_sha2_password,要改成5.7的mysql_native_password。

(注意:C:\ProgramData是隐藏目录,直接将路径在文件夹中拷入

# The default authentication plugin to be used when connecting to the server
#caching_sha2_password
default_authentication_plugin=mysql_native_password

保存my.ini后,在任务管理器里,右击MySQL80服务,重启服务。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

diaya

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值