Skip to main content
 首页 » 数据库

c# 调用mysql数据库验证用户名和密码

2022年07月19日163zhoujg

使用mysql数据库验证用户名和密码时,如果用户名是中文,一直查不到数据

需要把app.config 中修改为

数据库统一设置utf8编码格式,连接数据库的时候设置编码Charset=utf8可以避免,例如:string connectiontext = "Server=139.222.313.153;Database=testsys;User=root;Password=1123456;Charset=utf8;";

这样就调试OK


本文参考链接:https://www.cnblogs.com/xihong2014/p/10914303.html