Authentication to host '' for user '' using method 'mysql_native_password' failed with message
来源:互联网 发布:商业计划书编写软件 编辑:程序博客网 时间:2024/05/09 00:07
每次走到ITOO.Library.Core.Common.MySqlHelper.ExecuteDataTableNonConn(sql);的时候就会报错:
Authentication tohost '' for user '' using method 'mysql_native_password' failed with message:Access denied for user ''@'xxx' (using password: NO)
//连接数据库 string connstr = ITOO.Library.Core.Common.MySqlHelper.connectionString; MySqlConnection conn = ITOO.Library.Core.Common.MySqlHelper.GetConnection;
connstr和conn读取到的值为空
配置文件中连接数据库代码:
<add key="connectionString" value="Database=xxxx;Data Source=192.168.22.xxx;Port=3306;User Id=xxx;Charset=utf8;Password=xxx;TreatTinyAsBoolean=true;allow zero datetime=true" />
我着实的检查了每个配置文件的数据库连接地址,数据库名和密码都是没有错的
错误原因:
底层代码被改
这是底层代码:
public static string connectionString = System.Configuration.ConfigurationManager.AppSettings["strDBKey"];
底层接收的值是strDBKey而不是connectionString
解决方法:
将配置文件中连接数据库的字段改为:key="strDBKey"
1 0
- Authentication to host '' for user '' using method 'mysql_native_password' failed with message
- EF 连接mysql Authentication to host '' for user 'root' using method 'mysql_n(远程登录mysql失败)
- pgpool authentication with pgpool failed for user
- PostgreSQL: IDENT authentication failed for user postgres
- error:password authentication failed for user
- Host Credentials报错"Connection to host as user oracle failed: ERROR: Wrong password for user"的解决一例
- OperationalError: FATAL: Ident authentication failed for user “postgres”
- psql: FATAL: Peer authentication failed for user “xxx”
- psql: FATAL: Ident authentication failed for user “postgres”
- Postgres psql: FATAL: Peer authentication failed for user "xxx"
- Installation failed with with message Failed to establish session
- yii Exception (Exception) 'yii\base\Exception' with message 'Failed to change permissions for direc
- Installation failed with message INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries
- 解决Installation failed with message failed to establish session
- Installation failed with message Failed to establish session(小米手机)
- Installation failed with message INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries
- Installation failed with message Failed to establish session.
- Installation failed with message Failed to establish session解决方案
- Java学习----day4——(1)关于栈内存和堆内存的初步了解
- spark troubleshooting--解决yarn-cluster模式的JVM栈内存溢出问题
- Android的apk防止其他人直接用好压等软件解压
- Android Studio中提交项目到GitHub 和提交文件
- PASTE Splay
- Authentication to host '' for user '' using method 'mysql_native_password' failed with message
- 1048. 数字加密(20) python篇
- spark troubleshooting--解决各种序列化导致的错误
- 批量出售QQ群idcnd传媒提供
- java设计模式之代理模式
- 我理解的PCA
- 递归递推之数学黑洞
- 使用python原生态的min和max函数实现升序排序和降序排序
- socket_read 收不到数据,怎么修改超时时间?