Authentication failed using method mysql_native_password
c#, mysql, mysql-connector, visual-studio-2012, winforms
Solution
Its problem of 'Remote Database Access Hosts'. "You can allow external web servers to access your MySQL databases by adding their domain name to the list of hosts that are able to access databases on your web site."
MySql access is not granted to IP address of the system at which application is running.(in your case its '2.2.2.2' ).
Note:- '2.2.2.2' is your public IP address.
Problem
Trying to connect to MySQL on my web host, using Connector/Net C#/WinForms in Visual Studio 2012 Update 3, but getting the below error message: Authentication to host '1.1.1.1' for user 'username@mydomain.com' using method 'mysql_native_password' failed with message: Access denied for user 'username@mydomain.com'@'2.2.2.2' (using password: YES) ``` string connectionString = "SERVER=1.1.1.1;PORT=3306;DATABASE=databaseName;UID=username@mydomain.com;PASSWORD=mypassword;"; MySqlConnection connection = new MySqlConnection(connectionString); connection.Open(); ``` I am connecting remotely, have whitelisted my IP (and even temporary whitelisted all (%) to test), triple checked the username and password and IP. I originally tried the username without the domain ( username rather than username@mydomain.com) but it gave me the below error: Authentication with old password no longer supported, use 4.1 style passwords. Any assistance would be much appreciated, thanks!