MySql.Data.MySqlClient.MySqlException using password:YES
Publicado por Alberto (2 intervenciones) el 18/07/2020 04:05:36
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
private void btnAgregar_Click(object sender, EventArgs e)
{
String Nocliente = txtNocliente.Text;
String Nombre = txtNombre.Text;
String Apellidos = txtApellidos.Text;
String Correo = txtCorreo.Text;
String sql = "INSERT INTO cliente (Nocliente, Nombre, Apellidos, Correo) VALUES('" + Nocliente + "','" + Nombre + "','" + Apellidos + "','" + Correo + "')";
MySqlConnection conexionBD = Conexion.conexion();
conexionBD.Open();
try
{
MySqlCommand comando = new MySqlCommand(sql, conexionBD);
comando.ExecuteNonQuery();
MessageBox.Show("Registro Guardado");
}
catch (MySqlException ex)
{
MessageBox.Show("Error al guardar: " + ex.Message);
}
finally
{
conexionBD.Close();
}
Me gustaria mucho una ayuda con esto ya que no le encuentro solucion, estoy haciendo una base de datos en mysql y la pase a c# al momento de querer agregar datos me sale este error: MySql.Data.MySqlClient.MySqlException: 'Authentication to host '' for user 'root' using method 'mysql_native_password' failed with message: Access denied for user 'root'@'DESKTOP-PIQQQGH' (using password: YES)' espero me puedan ayudar :D
Valora esta pregunta


0