Connect to Flexible Server in Azure Database for MySQL on Azure Data Studio

János Csampai 1 Reputation point
2022-09-17T17:17:57.697+00:00

Hello everyone,

I'm currently having problems connecting to my Flexible Server in Azure Database for MySQL Instance in Azure Data Studio.

  • The instance is running
  • The firewall settings include my IP
  • Connecting works on the shell on Azure Portal and even the Shell on Azure Data Studio
  • Connecting on MySQL Workbench works

I can't see the Flexible Server in Azure Database for MySQL in the Azure Section on the left:
242150-image.png
And when using this setup with or without the password, with or without a database name:
242195-image.png
I always get this error:

Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)  
 ---> System.ComponentModel.Win32Exception (53): Der Netzwerkpfad wurde nicht gefunden.  
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)  
   at Microsoft.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover, SqlAuthenticationMethod authType)  
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)  
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)  
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)  
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool)  
   at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)  
   at Microsoft.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)  
   at Microsoft.Data.ProviderBase.DbConnectionFactory.<>c__DisplayClass48_0.<CreateReplaceConnectionContinuation>b__0(Task`1 _)  
   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()  
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)  
--- End of stack trace from previous location ---  
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)  
--- End of stack trace from previous location ---  
   at Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection.ReliableSqlConnection.<>c__DisplayClass30_0.<<OpenAsync>b__0>d.MoveNext() in D:\a\_work\1\s\src\Microsoft.SqlTools.ManagedBatchParser\ReliableConnection\ReliableSqlConnection.cs:line 316  
--- End of stack trace from previous location ---  
   at Microsoft.SqlTools.ServiceLayer.Connection.ConnectionService.TryOpenConnection(ConnectionInfo connectionInfo, ConnectParams connectionParams) in D:\a\_work\1\s\src\Microsoft.SqlTools.ServiceLayer\Connection\ConnectionService.cs:line 685  
ClientConnectionId:00000000-0000-0000-0000-000000000000  
Error Number:53,State:0,Class:20  

I have not found any solutions online.

Thank you very much,

János

Azure Data Explorer
Azure Data Explorer
An Azure data analytics service for real-time analysis on large volumes of data streaming from sources including applications, websites, and internet of things devices.
576 questions
Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
986 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. GeethaThatipatri-MSFT 29,542 Reputation points Microsoft Employee Moderator
    2022-09-18T20:50:29.507+00:00

    Hi, @János Csampai Welcome to the Microsoft Q&A forum, Thanks for posting your question and for using Azure services.
    As we understand you are trying to connect Azure Mysql from Azure Data studio and you cannot find your flexible server for Mysql correct me if my understanding is wrong.
    As for azure data studio, it is not going to work since I don't think it has the MySQL Plugin/Driver to make a connection to a MySQL server, only for SQL Server, Postgres, Synapse Analytics, and CosmosDB API for MongoDB.
    Please find the documentation here

    Please let me know if you need any additional information.

    Regards
    Geetha

    Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.