Mysql Access denied for user & #39; root & #39; @ & #39; localhost & #39; (using password: YES), deniedlocalhost

Source: Internet
Author: User

Mysql Access denied for user 'root' @ 'localhost' (using password: YES), deniedlocalhost

[Symptom description]

C/S program remote access is normal, local access reports the following exception

MySql.Data.MySqlClient.MySqlException (0x80004005): Authentication to host 'localhost' for user 'root' using method 'mysql_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';Data Source='localhost';User Id='root';Password='123456';charset='gb2312';pooling=true" providerName="MySql.Data.MySqlClient"/>


[Analysis]

For permission issues, check the user table in the mysql database.


It is found that the nominal value of localhost is null, so the localhost in connection string is changed to 127.0.0.1. The test passes ~~~

[Solution]


The configuration file is changed to localhost, and the database access is normal. At the same time, the mysql command line tool enters the password, and the problem is solved in a flash.


In addition, the mysql command line tool flashed through. For more information, see here.


Related Article

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.