Authentication to host '10.167.32.123' for user 'root' using method 'mysql_native_password' failed with message: Reading from the stream has failed

连接Mysql5.7以上的版本的数据库出现报错:

C#连接远程连接mysql时,抛异常:Authentication to host '10.167.32.123' for user 'root' using method 'mysql_native_password' failed with message: Reading from the stream has failed

最终在Mysql官网的bug提交区发现已经有人也遇到同样的问题并给出了解决方案,引起此错误的主要原因是在Mysql5.7及其以上版本中引入了SSL验证方式,如果不需要用到SSL验证,则在连接字符串时需要加入"SslMode=None"。如:server=10.167.32.123;port=3307;user=root; password=123456;database=intelligentpatrol;SslMode=None;就好了。

posted @   之广  阅读(691)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
我的博客——易之广
点击右上角即可分享
微信分享提示