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
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/mysql-azure/deploy.md
+27-20Lines changed: 27 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,14 @@ layout: learningpathall
8
8
9
9
## Install MySQL on Azure Cobalt 100
10
10
11
-
This section walks you through installing and securing MySQL on an Azure Arm64 virtual machine. You will set up the database, configure access, and verify it’s running—ready for development and testing.
11
+
This section demonstrates how to install and secure MySQL on an Azure Arm64 virtual machine. You will configure the database, set up security measures, and verify that the service is running properly, making the environment ready for development, testing, or production deployment.
12
12
13
-
Start by installing MySQL and other essential tools:
13
+
## Install MySQL and Tools
14
14
15
-
## Install MySQLand tools
15
+
Before installing MySQL, it’s important to ensure your VM is updated so you have the latest Arm64-optimized libraries and security patches. Ubuntu and other modern Linux distributions maintain Arm-native MySQL packages, so installation is straightforward with the system package manager.
16
16
17
17
1. Update the system and install MySQL
18
-
You update your system's package lists to ensure you get the latest versions and then install the MySQL server using the package manager.
18
+
Update your system's package lists to ensure you get the latest versions and then install the MySQL server using the package manager.
After installing MySQL, You are locking down your database so only you can access it safely. It’s like setting up a password and cleaning up unused accounts to make sure no one else can mess with your data.
27
+
Once MySQL is installed, the default configuration is functional but not secure.
28
+
You will lock down your database so only you can access it safely. This involves setting up a password and cleaning up unused accounts to make sure no one else can access your data.
28
29
29
30
```console
30
31
sudo mysql_secure_installation
31
32
```
32
-
Follow the prompts:
33
+
This interactive script walks you through several critical security steps. Follow the prompts:
33
34
34
35
- Set a strong password for root.
35
36
- Remove anonymous users.
36
37
- Disallow remote root login.
37
38
- Remove test databases.
38
39
- Reload privilege tables.
39
40
41
+
After securing your MySQL installation, the database is significantly harder to compromise.
42
+
40
43
3. Start and enable MySQL service
41
-
You are turning on the database so it starts working and making sure it stays on every time you turn on your computer.:
44
+
After installation and securing MySQL, the next step is to ensure that the MySQL server process (mysqld) is running and configured to start automatically whenever your VM boots.
42
45
43
46
```console
44
47
sudo systemctl start mysql
45
48
sudo systemctl enable mysql
46
49
```
47
-
Check the status:
50
+
Verify MySQL Status:
48
51
49
52
```console
50
53
sudo systemctl status mysql
51
54
```
52
-
The output should look like:
55
+
You should see output similar to:
53
56
54
57
```output
55
58
mysql.service - MySQL Community Server
@@ -63,11 +66,11 @@ mysql.service - MySQL Community Server
63
66
CGroup: /system.slice/mysql.service
64
67
└─3255 /usr/sbin/mysqld
65
68
```
66
-
You should see `active (running)`.
69
+
You should see `active (running)` in the output, which indicates that MySQL is up and running.
67
70
68
71
4. Verify MySQL version
69
72
70
-
You check the installed version of MySQL to confirm it’s set up correctly and is running.
73
+
You check also check the installed version of MySQL to confirm it’s set up correctly and is running.
71
74
72
75
```console
73
76
mysql -V
@@ -79,12 +82,12 @@ mysql Ver 8.0.43-0ubuntu0.24.04.1 for Linux on aarch64 ((Ubuntu))
79
82
```
80
83
5. Access MySQL shell
81
84
82
-
You log in to the MySQL interface using the root user to interact with the database and perform administrative tasks:
85
+
After confirming that MySQL is running, the next step is to log in to the MySQL monitor (shell). This is the command-line interface used to interact with the database server for administrative tasks such as creating users, managing databases, and tuning configurations.
83
86
84
87
```
85
88
sudo mysql
86
89
```
87
-
You should see output similar to the following:
90
+
You should see output similar to:
88
91
89
92
```output
90
93
Welcome to the MySQL monitor. Commands end with ; or \g.
@@ -101,16 +104,18 @@ Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
101
104
102
105
mysql>
103
106
```
107
+
The `mysql> prompt` indicates you are now in the MySQL interactive shell and can issue SQL commands.
104
108
105
109
6. Create a new user
106
110
107
-
You are setting up a new area to store your data and giving someone special permissions to use it. This helps you organize your work better and control who can access it:
111
+
While the root account gives you full control, it’s best practice to avoid using it for day-to-day database operations. Instead, you should create separate users with specific privileges.
112
+
Start by entering the MySQL shell:
108
113
109
114
```console
110
115
sudo mysql
111
116
```
112
117
113
-
Inside the MySQL shell, run:
118
+
Inside the shell, create a new user:
114
119
115
120
```sql
116
121
CREATEUSER 'admin'@'localhost' IDENTIFIED BY 'MyStrongPassword!';
@@ -119,19 +124,21 @@ FLUSH PRIVILEGES;
119
124
EXIT;
120
125
```
121
126
122
-
-Replace **MyStrongPassword!** with the password you want.
123
-
- This reloads the privilege tables so your new password takes effect immediately.
127
+
Replace `MyStrongPassword!` with a strong password of your choice.
128
+
`FLUSH PRIVILEGES;` Reloads the in-memory privilege tables from disk, applying changes immediately.
124
129
125
130
## Verify Access with New User
126
131
127
-
You test logging into MySQL using the new user account to ensure it works and has the proper permissions. In my case new user is `admin`.
132
+
Once you’ve created a new MySQL user, it’s critical to test login and confirm that the account works as expected. This ensures the account is properly configured and can authenticate against the MySQL server.
133
+
134
+
Run the following command ( for user `admin`):
128
135
129
136
```console
130
137
mysql -u admin -p
131
138
```
132
-
- Enter your current `admin`password.
139
+
You will then be asked to enter the password you created in the previous step.
0 commit comments