How to connect to MySQL in Microsoft Azure with DBeaver

If you have the MySQL database available in Microsoft Azure, you need a convenient tool to connect and start working with it. DBeaver Ultimate and DBeaver Team Edition allow you to connect to MySQL databases in two ways: through a standard wizard and by using Cloud Explorer. Let’s look at how to use each of these methods step by step.

Connect with a standard wizard

With DBeaver’s connection wizard, you can connect to different types of databases, including those hosted in the cloud. To create a connection to an Azure Database for MySQL – Flexible Server database using a standard wizard, perform the following steps.

1. Open the application, and then, at the top of the application toolbar, select New Database Connection, in the list of database drivers select MySQL, and then select Next.

2. In the next step, you need to fill in the Server Host, Port, Username and Password fields.

3. If your configuration requires using an SSL certificate, go to the SSL tab, check the Use SSL box, and fill in the necessary fields. Please notice that Microsoft recommends enabling the Enforce SSL connection setting whenever possible for enhanced security.

4. After completing all the settings, you can check if everything is correct by clicking the Test Connection button. If the connection can be established, you will see a window with the result and driver information.

5. Finally, the last step is to click the OK button. The new connection will appear in the navigation tree.

Now you can connect to your database and start working with it.

Connect using Cloud Explorer

In addition to creating a connection using a standard wizard, you can use Cloud Explorer, which provides a single point of entry for all of your Azure databases.

Cloud Explorer is available only in DBeaver Ultimate and DBeaver Team Edition.

With Cloud Explorer, you can set up your cloud configuration one time and then work with the tool as a “mission control center” to create connections, edit configurations, and add as many new configurations as needed. Cloud Explorer also enables creating the connection with far fewer properties that you need to specify when using a standard wizard.

When you use Cloud Explorer to connect to a database, you first need to set up the Microsoft Azure cloud configuration in DBeaver.

To create a connection to an Azure Database for MySQL – Flexible Server database by using Cloud Explorer, perform the following steps.

1. Start by clicking on the Cloud icon on the left part of DBeaver top toolbar.

2. In the window that opens, go to the tab “Microsoft Azure”. Here you need to fill in only one field: Client ID. You can find it in your Azure AD account -> App registrations section.

After entering the ID, just click the Apply and close button, and you will see the configuration you created and the available databases.

If necessary, you can create as many configurations as you need, and they will be displayed by the list. In the Cloud Explorer window, you can conveniently switch between them.

To add, edit or delete the Microsoft Azure configuration click on the Plus, on the Pencil, or on the Trash button accordingly.

3. When you click the Expand button matching to the MySQL database, you will be redirected to authentication through Microsoft Azure in the external browser.

4. After successful authentication, all you have left to do is drag and drop your database from the list in Cloud Explorer to the Database Navigator. You may notice that it will be marked with a small cloud icon.

To establish a connection you need to click the Expand button or select your database and click the Connect button on the top toolbar.

Using the instructions above, you can easily connect to your MySQL database on Microsoft Azure using DBeaver applications. Connecting to cloud databases through a standard wizard works for all desktop products. At the same time, Cloud Explorer in DBeaver Ultimate and DBeaver Team Edition allows you not only to avoid filling out many fields, but also to work with several configurations at the same time conveniently.

Author: