"Description of the phenomenon"
c/S program remote Access normal, local access reported the following exception
MySql.Data.MySqlClient.MySqlException (0x80004005): Authentication to host ' localhost ' for user ' root ' using method ' MYSQ L_native_password ' failed with message:access denied for user ' root ' @ ' localhost ' (using Password:yes)---> Mysql.data . Mysqlclient.mysqlexception (0x80004005): Access denied for user ' root ' @ ' localhost ' (using Password:yes)
The configuration file is as follows:
<add name= "remoteconnstring" connectionstring= "database= ' Mealbooker ';D ata source= ' localhost '; User id= ' root '; password= ' 123456 '; charset= ' gb2312 ';p ooling=true "providername=" MySql.Data.MySqlClient "/>
Analysis
Permission questions, check out the user table in the MySQL database
When the value of localhost is found to be empty, then localhost in connection string is changed to 127.0.0.1, test pass ~ ~ ~
Solution
The configuration file is changed to localhost, access to the database is normal, and the MySQL command line tool entered the password after a flash and solve the problem at the same time.
In addition, the MySQL command line tool flashed over, method see here
MySQL Access denied for user ' root ' @ ' localhost ' (using Password:yes)