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