I have MySQL database at cloud which can be accessed using SSH tunnel. however i am using c# to connect to the database. i also installed SQL connector for visual studio as well.
Here are the steps i followed.
- Installed
SQLYog
for SSH client. - tried to connect through
SQLYog
.connection successful
. tried to connect from c#.
connection unsuccessful
.Code :
MySqlConnection myConn; string connStr = "server=localhost;user id=xxxxxxx;password=xxxxxxx;port=3306;persistsecurityinfo=False;"; myConn = new MySqlConnection(connStr); myConn.Open();
Exception :
Unable to connect to any of the specified MySQL host.