MySQL Access denied for user & #39;root& #39;@& #39;localhost& #39; (using Password:yes)

Source: Internet
Author: User
Tags mysql command line

"Description of the phenomenon"

c/S program remote access to normal, local visits to report the following anomalies

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)

Configuration files such as the following:

<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


found that the following value for localhost is empty, so that localhost in connection string is changed to 127.0.0.1. Test Pass ~ ~ ~

Solution


Change config file to localhost, access to the database is normal; the same time MySQL command line tool input password after the problem is resolved at the same time.

After restarting and visiting can not, continue the above ideas change:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvc2hpbmv5y2g=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/center ">


Another, the MySQL command line tool flashed over, method to see here


There is also a permissions-related issue:

Error code:1370 Execute command denied to user ' root ' @ ' localhost ' for routine

Use Grant execute on procedure/function dbname.fname to ' root ' @ ' localhost ';



There is a password related issues (commissioning machine put a few days after the remote access to ask, Rootpassword was modified, unknown reason):

Authentication to host ' 10.10.123.6 ' for the user ' root ' using method ' Mysql_native_password ' failed with message:access Deni ed for user ' root ' @ ' 10.10.123.5 ' (using Password:yes)---> MySql.Data.MySqlClient.MySqlException (0x80004005): Access denied for user ' root ' @ ' 10.10.123.5 ' (using Password:yes)

Change the password statement such as the following:


And then you have to give the remote user a non-provisioning privilege

Grant all privileges on * * to ' root ' @ '% ' with grant option;


MySQL Access denied for user & #39;root& #39;@& #39;localhost& #39; (using Password:yes)

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.