Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Cannot connect to MySql in .Net

Hi, I cannot seem to connect to MySql client from my c# code.

I have my connectionString 

var connectionString = new MySqlConnectionStringBuilder()
{
Server = public ip address of instance,
UserID = user id, 
Password = password, 
Database = databaseName, 
};

This always results in timeouts.

Is there a way to connect to mysql using google credentials? similar to here https://stackoverflow.com/questions/73078590/google-spanner-execute-a-query-using-custom-credentials... ?

Edit: We are ip whitelisting and dev environment can't be added to the list, so I need to use service account
Edit: Got it done through Cloud Sql Proxy

0 1 98
1 REPLY 1

Hi. irida

There may be many reasons. Check whether the network is assigned to the Authorized networks in Instance > Connections > NETWORKING.