Unity连接MySQL失败总结

错误:

Assembly 'Assets/Dlls/MySql.Data.dll' will not be loaded due to errors:
Unable to resolve reference 'Google.Protobuf'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.

原因:缺少dll文件

解决办法:在参考诸多文章之后的解决办法基本都是降低版本,我尝试在MySql.Data.dll文件的同级目录中找一个叫“Google.Protobuf.dll”的文件并放入Unity,成功解决

错误:Authentication method  caching_sha2_password  not supported by any of the available plugins.

原因:MySql8.0版本之后用的密码验证方式不同导致

解决方法:修改my.ini文件的默认验证方式及修改登录账号的验证方式然后重启mysql服务即可,但是我仍然验证失败,尝试很多次之后选择重启电脑(解决)

步骤:在MySQL Server安装目录中修改或者添加my.ini

[mysqld]
default_authentication_plugin=mysql_native_password
default-character-set=utf8 [client]
port=3306 default-character-set=utf8

重点是:

default_authentication_plugin=mysql_native_password

然后在控制台重启MySQL服务:

net stop 服务名
net start 服务名

我的服务名称为MySQL80:

至此完结

  • 8
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Zirofen

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

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

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

打赏作者

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

抵扣说明:

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

余额充值