MySql authentication problem

0

It turns out that after I did all the steps to tell the database, add connections, until then everything went great, until when I finished adding my tables and their field, that I execute my program I get this. I made a button in my meno that allows me to access the report. When I hit the button I get this error:

  

Authentication to host 'localhost' for user 'root' using method   'mysql_native_password' failed with message: Access denied for user   'root' @ 'localhost' (using password: NO)

This is the code for my Report form:

  using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;

    namespace Consultorio_Clinico
    {
        public partial class ReporteC : Form
        {
            public ReporteC()
            {
                InitializeComponent();
            }


            private void ReporteC_Load(object sender, EventArgs e)
            {
                // TODO: esta línea de código carga datos en la tabla 'DataSet1.consulta' Puede moverla o quitarla según sea necesario.
                this.consultaTableAdapter.Fill(this.DataSet1.consulta);

                this.reportViewer1.RefreshReport();
            }

            private void reportViewer1_Load(object sender, EventArgs e)
            {

            }
        }
    }

    
asked by Nataliel 18.08.2017 в 14:42
source

1 answer

0

This is the format that a MySql connection string should follow from .NET:

<add name="mySqlConnectionString" connectionString="server=localhost;database=myDb;uid=myUser;password=myPass;" />
    
answered by 18.08.2017 в 15:24