Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connection to Azure MySQL server fails due to incorrect connection string

When trying to connect to my MySQL server in Azure from mysql client, I get the following error, even though I am using the correct username and server name. How can I fix this?

The connection string may not be right. Please visit portal for references.

like image 510
Shantanu Avatar asked May 17 '17 22:05

Shantanu


People also ask

Can't connect to MySQL server on Azure?

If the application persistently fails to connect to Azure Database for MySQL, it usually indicates an issue with one of the following: Server firewall configuration: Make sure that the Azure Database for MySQL server firewall is configured to allow connections from your client, including proxy servers and gateways.

How do I change my connection string in Azure?

Configure connection strings. In the Azure portal, search for and select App Services, and then select your app. In the app's left menu, select Configuration > Application settings. For ASP.NET and ASP.NET Core developers, setting connection strings in App Service are like setting them in <connectionStrings> in Web.


1 Answers

When connecting to your server instance of Azure Database for MySQL, you are required to follow the <username@hostname> format , whether you are doing it from mysqlexe client or MySQL workbench. We recommend you get the complete connection string for your client from the Azure portal and use it when connecting to your MySQL server.

Read How to get Connection Information to understand more about how to connect to your MySQL server from various clients.

like image 83
Shantanu Avatar answered Sep 28 '22 03:09

Shantanu