user1033744
user1033744

Reputation: 73

Desktop connection to MySQL in Amazon EC2 using C# (How To)

In my desktop application I need to connect to MySQL database in Amazon EC2. I tried to built the connection string but am very confused as to what parameters I need to include and how the connection string should look like and what commands need to call. Can anyone experience in this provide me with sample listings so that I can follow? Your help is very much appreciated.

Information I have on EC2 which I use to connect successfully using Workbench:

Upvotes: 1

Views: 1266

Answers (1)

user1033744
user1033744

Reputation: 73

After some research over the internet, I have found the answer to this seemingly simple question. All I need to do really is add in MySQL /net connector in the project and referenced it. Then I used the follwoing connecting string:-

eg: myConnStr = "host=ec2-xxx-xx-xx-xxx.compute-1.amazonaws.com" + ";Port=3306;UserName=your_db_username" + ";Password=your_db_password;Database=your_db;";

Thanks!

Upvotes: 1

Related Questions