MySQL Access denied for user ' root ' @ ' localhost ' (using Password:yes)

Source: Internet
Author: User

"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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.