简体   繁体   English

使用方法 'mysql_native_password' 对用户 'root' 的主机 'localhost' 进行身份验证失败并显示消息(使用密码:否)

[英]Authentication to host 'localhost' for user 'root' using method 'mysql_native_password' failed with message (using password: NO)

Can you help me guys for my thesis and this is one of my problem in my system.你能帮我写论文吗,这是我系统中的问题之一。

MySqlConnection cn2 = new MySqlConnection(cn.ConnectionString);
cn2.Open();-->>> Authentication to host 'localhost' for user 'root' using method 'mysql_native_password' failed with message: Access denied for user 'root'@'localhost' (using password: NO)

listView1.Items.Clear();
string sql = "Select * from tblrecord where DateTime between '" + dateTimePicker1.Value + "' and '" + dateTimePicker2.Value + "'";
cm = new MySqlCommand(sql);
//cm = new MySqlCommand(sql, cn1);
dr = cm.ExecuteReader();
dr.Read();
if (dr.HasRows)

只需在连接字符串中添加密码,因为您尚未在连接中添加密码。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用方法“mysql_native_password”对用户“root”的主机“127.0.0.1”进行身份验证失败,并显示消息:未知数据库“xxx” - Authentication to host '127.0.0.1' for user 'root' using method 'mysql_native_password' failed with message: Unknown database 'xxx' 使用方法“ mysql_native_password”对主机或用户进行身份验证失败 - authentication to host or user using method 'mysql_native_password' failed 使用方法“mysql_native_password”对用户“用户名”的主机“192.168.0.31”进行身份验证失败,并显示消息:未知数据库“mysql57” - Authentication to host '192.168.0.31' for user 'username' using method 'mysql_native_password' failed with message: Unknown database 'mysql57' 如何修复“使用方法 'mysql_native_password' 为用户进行身份验证失败并显示消息:从流中读取失败。” 在.NET中 - How to fix 'Authentication to host for user using method 'mysql_native_password' failed with message: Reading from the stream has failed.' in .NET 使用方法 mysql_native_password 验证失败 - Authentication failed using method mysql_native_password 使用方法“ mysql_native_password”失败 - using method 'mysql_native_password' failed 方法'mysql_native_password'失败并显示消息:用户''@'RAHUL-PC'的访问被拒绝(使用密码:是) - method 'mysql_native_password' failed with message: Access denied for user ''@'RAHUL-PC' (using password: YES) C# - 意外的身份验证方法 mysql_native_password 异常 - C# - Unexpected authentication method mysql_native_password exception 从流读取失败 - mysql_native_password错误 - Reading from stream failed - mysql_native_password error 带有实体框架6的mysql 5.7-拒绝用户'root'@'localhost'的访问(使用密码:NO) - mysql 5.7 with entity framework 6 - Access denied for user 'root'@'localhost' (using password: NO)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM