MySql8使用点滴

由于工作的需要,安装了Mysql8.0.28.0,调试原来的WPF项目,却遇到了两个问题:

1  打开连接时,报异常信息:A call to SSPI failed, see inner exception.

     内部信息:The message received was unexpected or badly formatted

     经查找资料,发现是连接字串有问题,原来的连接字串是:private string connectionString = @"Server=localhost;Port=3306;Uid=root;Pwd=root;Database=MyDB;";

     需要添加:SslMode=None; 

     修改为:private string connectionString = @"Server=localhost;Port=3306;Uid=root;Pwd=root;SslMode=None; Database=MyDB;";

     相关情况参加如下:

 

 

 

 2  任何可用插件都不支持认证方法'caching_sha2_password'

     Authentication method 'caching_sha2_password' not supported by any of the available plugins.

    

 

 

    解决方法:

    1 查找Mysql的配置文件my.ini(其实是同一个文件):如下

    

     2.2  打开文件my.ini,添加:default_authentication_plugin=mysql_native_password如下:

      

 

     2.3  Win+R输入Services,打开服务管理器,重启Mysql

      

 

至此,MySql8.0.28.0的两个问题就解决了,项目程序就可以调试了。

希望能帮助到使用MySql8.0的朋友们。

 

posted on 2022-03-11 22:56  博观约取*厚积薄发  阅读(374)  评论(0)    收藏  举报