I've just set up a MySQL database in AWS, however every time I try to connect programmatically I get an access denied exception. Connecting through MySQL Workbench works absolutely fine.
I've added my IP address to the Inbound Rules in AWS (without it, Workbench can't connect so it's definitely set up somewhat correctly) and even added a rule to allow all IP addresses for all traffic:
This is a bare minimum example of what I'm trying to do:
using MySql.Data.MySqlClient;
MySqlConnection connection = new(CONNECTION_STRING);
connection.Open();
which throws the exception on connection.Open().
Connection string:
Server=aa11sgbkk911b5j.cevakqici96g.eu-west-2.rds.amazonaws.com;Database=ebdb;Uid=username;Pwd=password;
The exact exception:
MySql.Data.MySqlClient.MySqlException
HResult=0x80004005
Message=Authentication to host 'aa11sgbkk911b5j.cevakqici96g.eu-west-2.rds.amazonaws.com' for user 'username' using method 'mysql_native_password' failed with message: Access denied for user 'burntorangeadmin'@'cpc150000-brnt4-2-0-cust812.5-2.cable.virginm.net' (using password: YES)
Source=MySql.Data
...
Does anyone have any idea why I can't connect?
