You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Azure Database for MySQL flexible server performs periodic maintenance to keep your managed database secure, stable, and up-to-date. During maintenance, the server gets new features, updates, and patches.
This quickstart demonstrates how to connect to an Azure Database for MySQL - Flexible Server using Azure CLI with ```az mysql flexible-server connect``` and execute single query or sql file with ```az mysql flexible-server execute``` command. This command allows you test connectivity to your database server and run queries. You can also run multiple queries using the interactive mode.
17
+
This quickstart demonstrates how to connect to Azure Database for MySQL flexible server using Azure CLI with `az mysql flexible-server connect` and execute single query or sql file with the `az mysql flexible-server execute` command. This command allows you test connectivity to your database server and run queries. You can also run multiple queries using the interactive mode.
- Install [Azure CLI](/cli/azure/install-azure-cli) latest version (2.20.0 or higher)
25
-
- Log in using Azure CLI with ```az login``` command
26
-
- Turn on parameter persistence with ```az config param-persist on```. Parameter persistence helps you use local context without having to repeat numerous arguments like resource group or location etc.
25
+
- Log in using Azure CLI with the `az login` command
26
+
- Turn on parameter persistence with `az config param-persist on`. Parameter persistence helps you use local context without having to repeat numerous arguments like resource group or location.
27
27
28
28
## Create a MySQL Flexible Server
29
29
30
-
The first thing we create is a managed MySQL server. In [Azure Cloud Shell](https://shell.azure.com/), run the following script and make a note of the **server name**, **username** and **password** generated from this command.
30
+
The first thing to create is a managed Azure Database for MySQL flexible server instance. In [Azure Cloud Shell](https://shell.azure.com/), run the following script and make a note of the **server name**, **username** and **password** generated from this command.
31
31
32
32
```azurecli-interactive
33
33
az mysql flexible-server create --public-access <your-ip-address>
@@ -162,7 +162,7 @@ test 200
162
162
163
163
## Run SQL File
164
164
165
-
You can execute a sql file with the command using ```--file-path``` argument, ```-q```.
165
+
You can execute a sql file with the command using `--file-path` argument, `-q`.
166
166
167
167
```azurecli-interactive
168
168
az mysql flexible-server execute -n <server-name> -u <username> -p "<password>" -d <database-name> --file-path "<file-path>"
@@ -186,5 +186,5 @@ Closed the connection to mysqldemoserver.
186
186
## Next Steps
187
187
188
188
> [!div class="nextstepaction"]
189
-
*[Connect to Azure Database for MySQL - Flexible Server with encrypted connections](how-to-connect-tls-ssl.md)
189
+
*[Connect to Azure Database for MySQL flexible server with encrypted connections](how-to-connect-tls-ssl.md)
190
190
*[Manage the server](./how-to-manage-server-cli.md)
This quickstart demonstrates how to connect to an Azure Database for MySQL by using a C# application. It shows how to use SQL statements to query, insert, update, and delete data in the database.
18
+
This quickstart demonstrates how to connect to an Azure Database for MySQL flexible server instance by using a C# application. It shows how to use SQL statements to query, insert, update, and delete data in the database.
- Create an Azure Database for MySQL - Flexible Server using [Azure portal](./quickstart-create-server-portal.md) <br/> or [Azure CLI](./quickstart-create-server-cli.md) if you do not have one.
27
+
- Create an Azure Database for MySQL flexible server instance by using the[Azure portal](./quickstart-create-server-portal.md) <br/> or [Azure CLI](./quickstart-create-server-cli.md) if you do not have one.
28
28
- Based on whether you are using public or private access, complete **ONE** of the actions below to enable connectivity.
29
29
-[Create a database and non-admin user](../single-server/how-to-create-users.md)
30
30
- Install the [.NET SDK for your platform](https://dotnet.microsoft.com/download) (Windows, Ubuntu Linux, or macOS) for your platform.
Get the connection information needed to connect to the Azure Database for MySQL. You need the fully qualified server name and login credentials.
47
+
Get the connection information needed to connect to the Azure Database for MySQL flexible server instance. You need the fully qualified server name and login credentials.
48
48
49
49
1. Log in to the [Azure portal](https://portal.azure.com/).
50
50
2. From the left-hand menu in Azure portal, select **All resources**, and then search for the server you have created (such as **mydemoserver**).
51
51
3. Select the server name.
52
52
4. From the server's **Overview** panel, make a note of the **Server name** and **Server admin login name**. If you forget your password, you can also reset the password from this panel.
53
-
:::image type="content" source="./media/connect-csharp/server-overview-name-login.png" alt-text="Azure Database for MySQL server name":::
53
+
:::image type="content" source="./media/connect-csharp/server-overview-name-login.png" alt-text="Azure Database for MySQL flexible server instance name":::
54
54
55
55
## Step 1: Connect and insert data
56
56
@@ -312,7 +312,7 @@ az group delete \
312
312
## Next steps
313
313
314
314
> [!div class="nextstepaction"]
315
-
> [Manage Azure Database for MySQL server using Portal](./how-to-manage-server-portal.md)<br/>
315
+
> [Manage Azure Database for MySQL flexible server using the portal](./how-to-manage-server-portal.md)<br/>
316
316
317
317
> [!div class="nextstepaction"]
318
-
> [Manage Azure Database for MySQL server using CLI](./how-to-manage-server-cli.md)
318
+
> [Manage Azure Database for MySQL flexible server using Azure CLI](./how-to-manage-server-cli.md)
This topic demonstrates creating a sample application that uses Java and [JDBC](https://en.wikipedia.org/wiki/Java_Database_Connectivity) to store and retrieve information in [Azure Database for MySQL - Flexible Server](../index.yml).
18
+
This topic demonstrates creating a sample application that uses Java and [JDBC](https://en.wikipedia.org/wiki/Java_Database_Connectivity) to store and retrieve information in [Azure Database for MySQL flexible server](../index.yml).
19
19
20
20
JDBC is the standard Java API to connect to traditional relational databases.
21
21
22
22
In this article, we'll include two authentication methods: Microsoft Entra authentication and MySQL authentication. The **Passwordless** tab shows the Microsoft Entra authentication and the **Password** tab shows the MySQL authentication.
23
23
24
-
Microsoft Entra authentication is a mechanism for connecting to Azure Database for MySQL using identities defined in Microsoft Entra ID. With Microsoft Entra authentication, you can manage database user identities and other Microsoft services in a central location, which simplifies permission management.
24
+
Microsoft Entra authentication is a mechanism for connecting to Azure Database for MySQL flexible server using identities defined in Microsoft Entra ID. With Microsoft Entra authentication, you can manage database user identities and other Microsoft services in a central location, which simplifies permission management.
25
25
26
26
MySQL authentication uses accounts stored in MySQL. If you choose to use passwords as credentials for the accounts, these credentials will be stored in the `user` table. Because these passwords are stored in MySQL, you'll need to manage the rotation of the passwords by yourself.
27
27
@@ -51,7 +51,7 @@ export CURRENT_USER_OBJECTID=$(az ad signed-in-user show --query id -o tsv)
51
51
52
52
Replace the placeholders with the following values, which are used throughout this article:
53
53
54
-
-`<YOUR_DATABASE_NAME>`: The name of your MySQL server, which should be unique across Azure.
54
+
-`<YOUR_DATABASE_NAME>`: The name of your Azure Database for MySQL flexible server instance, which should be unique across Azure.
55
55
-`<YOUR_AZURE_REGION>`: The Azure region you'll use. You can use `eastus` by default, but we recommend that you configure a region closer to where you live. You can see the full list of available regions by entering `az account list-locations`.
56
56
-`<YOUR_USER_ASSIGNED_MANAGED_IDENTITY_NAME>`: The name of your user assigned managed identity server, which should be unique across Azure.
Replace the placeholders with the following values, which are used throughout this article:
71
71
72
-
-`<YOUR_DATABASE_NAME>`: The name of your MySQL server, which should be unique across Azure.
72
+
-`<YOUR_DATABASE_NAME>`: The name of your Azure Database for MySQL flexible server instance, which should be unique across Azure.
73
73
-`<YOUR_AZURE_REGION>`: The Azure region you'll use. You can use `eastus` by default, but we recommend that you configure a region closer to where you live. You can see the full list of available regions by entering `az account list-locations`.
74
74
-`<YOUR_MYSQL_ADMIN_PASSWORD>` and `<YOUR_MYSQL_NON_ADMIN_PASSWORD>`: The password of your MySQL database server. That password should have a minimum of eight characters. The characters should be from three of the following categories: English uppercase letters, English lowercase letters, numbers (0-9), and non-alphanumeric characters (!, $, #, %, and so on).
75
75
@@ -86,12 +86,12 @@ az group create \
86
86
87
87
## Create an Azure Database for MySQL instance
88
88
89
-
### Create a MySQL server and set up admin user
89
+
### Create Azure Database for MySQL flexible server instance and set up an admin user
90
90
91
-
The first thing you'll create is a managed MySQL server.
91
+
The first thing you create is a managed Azure Database for MySQL flexible server instance.
92
92
93
93
> [!NOTE]
94
-
> You can read more detailed information about creating MySQL servers in [Create an Azure Database for MySQL server by using the Azure portal](./quickstart-create-server-portal.md).
94
+
> You can read more detailed information about creating MySQL servers in [Create an Azure Database for MySQL flexible server instance by using the Azure portal](./quickstart-create-server-portal.md).
> After creating the user-assigned identity, ask your *Global Administrator* or *Privileged Role Administrator* to grant the following permissions for this identity: `User.Read.All`, `GroupMember.Read.All`, and `Application.Read.ALL`. For more information, see the [Permissions](./concepts-azure-ad-authentication.md#permissions) section of [Active Directory authentication](./concepts-azure-ad-authentication.md).
125
125
126
-
Run the following command to assign the identity to MySQL server for creating Microsoft Entra admin:
126
+
Run the following command to assign the identity to Azure Database for MySQL flexible server for creating Microsoft Entra admin:
127
127
128
128
```azurecli-interactive
129
129
az mysql flexible-server identity assign \
@@ -144,9 +144,9 @@ az mysql flexible-server ad-admin create \
144
144
```
145
145
146
146
> [!IMPORTANT]
147
-
> When setting the administrator, a new user is added to the Azure Database for MySQL server with full administrator permissions. Only one Microsoft Entra admin can be created per MySQL server and selection of another one will overwrite the existing Microsoft Entra admin configured for the server.
147
+
> When setting the administrator, a new user is added to the Azure Database for MySQL flexible server instance with full administrator permissions. Only one Microsoft Entra admin can be created per Azure Database for MySQL flexible server instance and selection of another one will overwrite the existing Microsoft Entra admin configured for the server.
148
148
149
-
This command creates a small MySQL server and sets the Active Directory admin to the signed-in user.
149
+
This command creates a small Azure Database for MySQL flexible server instance and sets the Active Directory admin to the signed-in user.
150
150
151
151
#### [Password](#tab/password)
152
152
@@ -161,21 +161,21 @@ az mysql flexible-server create \
161
161
--output tsv
162
162
```
163
163
164
-
This command creates a small MySQL server.
164
+
This command creates a small Azure Database for MySQL flexible server instance.
165
165
166
166
---
167
167
168
-
The MySQL server that you created has an empty database called `flexibleserverdb`.
168
+
The Azure Database for MySQL flexible server instance that you created has an empty database called `flexibleserverdb`.
169
169
170
170
[Having any issues? Let us know.](https://github.com/MicrosoftDocs/azure-docs/issues)
171
171
172
-
### Configure a firewall rule for your MySQL server
172
+
### Configure a firewall rule for your Azure Database for MySQL flexible server instance
173
173
174
-
Azure Database for MySQL instances are secured by default. They have a firewall that doesn't allow any incoming connection.
174
+
Azure Database for MySQL flexible server instances are secured by default. They have a firewall that doesn't allow any incoming connection.
175
175
176
176
You can skip this step if you're using Bash because the `flexible-server create` command already detected your local IP address and set it on MySQL server.
177
177
178
-
If you're connecting to your MySQL server from Windows Subsystem for Linux (WSL) on a Windows computer, you'll need to add the WSL host ID to your firewall. Obtain the IP address of your host machine by running the following command in WSL:
178
+
If you're connecting to your Azure Database for MySQL flexible server instance from Windows Subsystem for Linux (WSL) on a Windows computer, you'll need to add the WSL host ID to your firewall. Obtain the IP address of your host machine by running the following command in WSL:
179
179
180
180
```bash
181
181
sudo cat /etc/resolv.conf
@@ -464,7 +464,7 @@ public class DemoApplication {
464
464
465
465
[Having any issues? Let us know.](https://github.com/MicrosoftDocs/azure-docs/issues)
466
466
467
-
This Java code will use the *database.properties* and the *schema.sql* files that you created earlier, in order to connect to the MySQL server and create a schema that will store your data.
467
+
This Java code will use the *database.properties* and the *schema.sql* files that you created earlier, in order to connect to the Azure Database for MySQL flexible server instance and create a schema that will store your data.
468
468
469
469
In this file, you can see that we commented methods to insert, read, update and delete data: you'll code those methods in the rest of this article, and you'll be able to uncomment them one after each other.
470
470
@@ -480,7 +480,7 @@ You can now execute this main class with your favorite tool:
480
480
- Using your IDE, you should be able to right-click on the *DemoApplication* class and execute it.
481
481
- Using Maven, you can run the application by executing: `mvn exec:java -Dexec.mainClass="com.example.demo.DemoApplication"`.
482
482
483
-
The application should connect to the Azure Database for MySQL, create a database schema, and then close the connection, as you should see in the console logs:
483
+
The application should connect to the Azure Database for MySQL flexible server instance, create a database schema, and then close the connection, as you should see in the console logs:
484
484
485
485
```output
486
486
[INFO ] Loading application properties
@@ -642,7 +642,7 @@ Executing the main class should now produce the following output:
642
642
643
643
[Having any issues? Let us know.](https://github.com/MicrosoftDocs/azure-docs/issues)
644
644
645
-
### Updating data in Azure Database for MySQL
645
+
### Updating data in Azure Database for MySQL flexible server
646
646
647
647
Next, update the data you previously inserted.
648
648
@@ -686,7 +686,7 @@ Executing the main class should now produce the following output:
686
686
[INFO ] Closing database connection
687
687
```
688
688
689
-
### Deleting data in Azure Database for MySQL
689
+
### Deleting data in Azure Database for MySQL flexible server
690
690
691
691
Finally, delete the data you previously inserted.
692
692
@@ -729,7 +729,7 @@ Executing the main class should now produce the following output:
729
729
730
730
## Clean up resources
731
731
732
-
Congratulations! You've created a Java application that uses JDBC to store and retrieve data from Azure Database for MySQL.
732
+
Congratulations! You've created a Java application that uses JDBC to store and retrieve data from Azure Database for MySQL flexible server.
733
733
734
734
To clean up all resources used during this quickstart, delete the resource group using the following command:
0 commit comments