你们能帮我完成论文吗,这是我系统中的一个问题。
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)
最佳答案
只需在您的连接字符串中添加密码,因为您还没有在您的连接中添加它。
关于c# - 使用方法 'localhost' 对用户 'root' 的主机 'mysql_native_password' 的身份验证失败并显示消息(使用密码 : NO),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39442151/