Databases Azure

MySQL 8.4 LTS on Windows Server 2025 on Azure User Guide

| Product: MySQL 8.4 LTS on Windows Server 2025

Overview

MySQL is the widely used open source relational database: standard SQL, transactions and row-level locking with InnoDB, replication, JSON documents and full-text search, behind applications of every size.

This image runs MySQL Community Server 8.4.13, the current release of the 8.4 long-term support series, as a Windows service on Windows Server 2025 Datacenter (Desktop Experience). MySQL listens on TCP 3306 and requires TLS 1.2 or 1.3 for every connection. On the first boot of every VM the image creates this VM's own data directory, its own certificate authority and TLS certificate, and its own passwords for root and admin, so nothing is shared between machines and no default password exists. The Windows Server licence is included in the virtual machine price that Microsoft bills; MySQL Community Server is open source under the GNU General Public License version 2. cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours.

What is included:

  • MySQL Community Server 8.4.13 from Oracle's Windows x64 archive (checksum and signature verified), installed in C:\Program Files\MySQL\MySQL Server 8.4, with mysql, mysqldump, mysqladmin and the other command line tools on the system path
  • The Windows service MySQL84, running as its own virtual service account NT SERVICE\MySQL84 (never LocalSystem), starting with Windows and restarting if it stops
  • Data, configuration and certificates in C:\ProgramData\MySQL\MySQL Server 8.4, readable only by the service account, SYSTEM and administrators
  • TLS required for every connection (require_secure_transport), TLS 1.2 and 1.3 only, with this VM's own certificate, issued by this VM's own certificate authority
  • Two accounts, both caching_sha2_password: root, which signs in from the VM only, and admin, with all privileges, which signs in from the network over TLS only
  • No RSA key pair for password exchange, no X Protocol, local_infile off and secure_file_priv NULL; utf8mb4 with the utf8mb4_0900_ai_ci collation by default
  • A Windows Firewall rule for TCP 3306, and a rule that stops MySQL reaching the Azure Instance Metadata Service and wire server
  • Windows Server 2025 Datacenter, patched with Windows Update at build, with Microsoft Defender Antivirus and Windows Firewall on
  • cloudimg's support team on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours

Prerequisites

An active Azure subscription, a Remote Desktop client, and a virtual network in the target region. Standard_B2ms (2 vCPU, 8 GiB RAM) is a good starting point for development and small applications; choose a larger size, with Premium SSD storage, for production workloads. In the network security group, allow inbound TCP 3389 (Remote Desktop) and TCP 3306 (MySQL) from your own address ranges only. To connect from your own computer you need a MySQL 8 client (mysql, MySQL Workbench, or your application's driver).

Step 1: Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for MySQL 8.4 LTS on Windows Server 2025 by cloudimg, and select Create. On Basics pick your subscription, resource group, region and size, and set the Administrator account username and password. Under Inbound port rules allow RDP (3389); after the VM is created, add an inbound rule for TCP 3306 in its network security group, with your own address range as the source. Select Review + create, then Create.

Step 2: Deploy from the Azure CLI

# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn cloudimg1647283583153:mysql-windows-server:default:latest

az vm create \
  --resource-group <your-rg> \
  --name mysql \
  --image cloudimg1647283583153:mysql-windows-server:default:latest \
  --size Standard_B2ms \
  --admin-username <admin-name> \
  --admin-password '<a strong password>' \
  --public-ip-sku Standard

az vm open-port --resource-group <your-rg> --name mysql --port 3389 --priority 1000
az vm open-port --resource-group <your-rg> --name mysql --port 3306 --priority 1010

az vm open-port opens each port to any address; narrow the rules to your own ranges in the network security group afterwards.

First boot takes a few minutes. When the VM first starts, Windows finishes its setup, then the image creates this VM's certificates, data directory and passwords, checks the server, and only then opens TCP 3306 in Windows Firewall. The setup is finished when the file C:\ProgramData\mysql-windows-server-firstboot.done exists (Step 4).

Step 3: Connect with Remote Desktop

Connect to the VM's public IP address with your Remote Desktop client (on Windows, mstsc; on macOS, Windows App), signing in with the administrator name and password you set at deployment. Open Windows PowerShell as administrator for the commands below. mysql and the other MySQL tools are on the system path.

Step 4: Confirm MySQL is running

Test-Path C:\ProgramData\mysql-windows-server-firstboot.done
Get-CimInstance Win32_Service -Filter "Name='MySQL84'" | Format-Table Name, State, StartMode, StartName -AutoSize
Get-NetTCPConnection -State Listen -LocalPort 3306 | Format-Table LocalAddress, LocalPort, @{n='Process';e={(Get-Process -Id $_.OwningProcess).ProcessName}} -AutoSize
mysql --version
mysql -h localhost -u root -p --table -e "SELECT VERSION(), @@datadir, @@require_secure_transport, @@tls_version"
Get-NetFirewallRule -Group MySQL | Format-Table Name, Direction, Action, Enabled -AutoSize
True

Name    State   StartMode StartName
----    -----   --------- ---------
MySQL84 Running Auto      NT SERVICE\MySQL84

LocalAddress LocalPort Process
------------ --------- -------
0.0.0.0           3306 mysqld

C:\Program Files\MySQL\MySQL Server 8.4\bin\mysql.exe  Ver 8.4.13 for Win64 on x86_64 (MySQL Community Server - GPL)

+-----------+---------------------------------------------+----------------------------+-----------------+
| VERSION() | @@datadir                                   | @@require_secure_transport | @@tls_version   |
+-----------+---------------------------------------------+----------------------------+-----------------+
| 8.4.13    | C:\ProgramData\MySQL\MySQL Server 8.4\Data\ |                          1 | TLSv1.2,TLSv1.3 |
+-----------+---------------------------------------------+----------------------------+-----------------+

Name                      Direction Action Enabled
----                      --------- ------ -------
cloudimg-MySQL-In           Inbound  Allow    True
cloudimg-MySQL-NoMetadata  Outbound  Block    True

mysql -u root -p asks for root's password from Step 5. The service MySQL84 runs as its own virtual account and starts automatically with Windows. mysqld listens on TCP 3306 on every address, require_secure_transport is on, so every connection must use TLS, and only TLS 1.2 and 1.3 are accepted. The firewall rule cloudimg-MySQL-In allows TCP 3306 in, and cloudimg-MySQL-NoMetadata stops mysqld reaching the Azure Instance Metadata Service and wire server.

An elevated PowerShell window on a new VM: first boot done, the MySQL84 service running as NT SERVICE\MySQL84, mysqld listening on TCP 3306, MySQL 8.4.13 with TLS required

Step 5: Read your MySQL passwords

First boot wrote this VM's passwords to a file that only the SYSTEM account and the Administrators group can read. To see it with the passwords hidden, and who can read it:

(Get-Content C:\ProgramData\mysql-windows-server-credentials.txt) -replace '(password=).*', '$1<hidden here>'
(Get-Acl C:\ProgramData\mysql-windows-server-credentials.txt).Access | Format-Table IdentityReference, FileSystemRights -AutoSize
# MySQL 8.4 LTS on Windows Server 2025 by cloudimg: this VM's own MySQL passwords (made at first boot).
# On this VM (mysql is on the PATH): mysql -u root -p
# From your own computer, after allowing TCP 3306 from your address in the network security group (the server
#   refuses any connection that does not use TLS): copy this VM's CA certificate (certificate.ca below) to your
#   computer as ca.pem, check its sha256 against certificate.ca.sha256 below, then connect verifying it:
#   mysql -h <VM address> -u admin -p --ssl-mode=VERIFY_IDENTITY --ssl-ca=ca.pem
# root signs in from this VM only; admin (all privileges) signs in from anywhere your network security group allows.
# Guide: https://www.cloudimg.co.uk/guides/mysql-on-windows-server-2025-azure/

mysql-windows-server.host=<VM address>
mysql-windows-server.port=3306
mysql-windows-server.ssl-mode=VERIFY_IDENTITY
mysql-windows-server.root.user=root
mysql-windows-server.root.password=<hidden here>
mysql-windows-server.admin.user=admin
mysql-windows-server.admin.password=<hidden here>
mysql-windows-server.certificate.ca=C:\ProgramData\MySQL\MySQL Server 8.4\tls\ca.pem
mysql-windows-server.certificate.ca.sha256=B4A32106D1E72593E4ECED75552F14B6A3AE48CB7564CA52F72F178ECAFB99AF
mysql-windows-server.certificate.server.sha256=CC0B6DFE70926C139B129B9A5D720A61E045453841F5BEFADD43FF101B121B7D

IdentityReference      FileSystemRights
-----------------      ----------------
NT AUTHORITY\SYSTEM         FullControl
BUILTIN\Administrators      FullControl

Open the file itself with Get-Content C:\ProgramData\mysql-windows-server-credentials.txt to read the passwords. root signs in from this VM only (root@localhost); admin has all privileges and signs in from the network, over TLS only. The certificate.*.sha256 lines are the fingerprints of this VM's own CA and server certificates, so you can check the copy of ca.pem you take to your computer. Keep the file safe; if you change a password in MySQL, the file still holds the first one.

An elevated PowerShell window: the credentials file readable by SYSTEM and Administrators only, and its settings with every password hidden

Step 6: Create a database and an application account

Give each application its own database and account rather than using admin. As root, on the VM (replace the placeholder with a password you choose):

@"
CREATE DATABASE appdb CHARACTER SET utf8mb4;
CREATE USER 'appuser'@'%' IDENTIFIED BY '<a password you choose>' REQUIRE SSL;
GRANT ALL PRIVILEGES ON appdb.* TO 'appuser'@'%';
SHOW GRANTS FOR 'appuser'@'%';
"@ | mysql -h localhost -u root -p --table
+----------------------------------------------------+
| Grants for appuser@%                               |
+----------------------------------------------------+
| GRANT USAGE ON *.* TO `appuser`@`%`                |
| GRANT ALL PRIVILEGES ON `appdb`.* TO `appuser`@`%` |
+----------------------------------------------------+

REQUIRE SSL makes TLS part of the account as well as the server setting. For an account that should only connect from your application servers, use their address or subnet instead of % (for example 'appuser'@'10.0.1.%').

Step 7: Connect over TLS, verifying the server

Every client must use TLS, and the safest setting is --ssl-mode=VERIFY_IDENTITY: the client checks that the server's certificate was issued by this VM's own CA and names the address you connected to. The certificate names the VM's public and private IP addresses, its computer name and localhost.

  1. Copy C:\ProgramData\MySQL\MySQL Server 8.4\tls\ca.pem to your computer (it is a public certificate, not a secret: copy and paste its text through the Remote Desktop clipboard, or copy the file).
  2. Check its fingerprint matches certificate.ca.sha256 from Step 5 (on Windows Get-FileHash ca.pem; on macOS or Linux shasum -a 256 ca.pem).
  3. Connect with your own mysql client:
mysql -h <VM address> -u appuser -p --ssl-mode=VERIFY_IDENTITY --ssl-ca=ca.pem appdb

The same connection, writing and reading a table and showing the session's TLS version and cipher:

@"
CREATE TABLE notes (id INT AUTO_INCREMENT PRIMARY KEY, body VARCHAR(200) NOT NULL, added TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);
INSERT INTO notes (body) VALUES ('hello from appuser over TLS');
SELECT id, body FROM notes;
SHOW SESSION STATUS WHERE Variable_name IN ('Ssl_version', 'Ssl_cipher');
"@ | mysql -h <VM address> -u appuser -p --ssl-mode=VERIFY_IDENTITY --ssl-ca=ca.pem --table appdb
+----+-----------------------------+
| id | body                        |
+----+-----------------------------+
|  1 | hello from appuser over TLS |
+----+-----------------------------+
+---------------+------------------------+
| Variable_name | Value                  |
+---------------+------------------------+
| Ssl_cipher    | TLS_AES_128_GCM_SHA256 |
| Ssl_version   | TLSv1.3                |
+---------------+------------------------+

Without TLS the server refuses the connection, even with the right password, and an account sees only what it was granted:

mysql -h <VM address> -u appuser -p --ssl-mode=DISABLED -e "SELECT 1" appdb
mysql -h <VM address> -u appuser -p --ssl-mode=VERIFY_IDENTITY --ssl-ca=ca.pem -e "SELECT COUNT(*) FROM mysql.user"
ERROR 1045 (28000): Access denied for user 'appuser'@'<client host>' (using password: YES)
ERROR 1142 (42000) at line 1: SELECT command denied to user 'appuser'@'<client host>' for table 'user'

In application connection strings set the equivalent options: for example sslMode=VERIFY_IDENTITY with the CA file in MySQL Connector/J, or SslMode=VerifyFull;SslCa=ca.pem in MySqlConnector for .NET.

An elevated PowerShell window: admin connected to the VM's own address with VERIFY_IDENTITY over TLS 1.3, and the server's databases

Server Components

Component Version or setting Where
MySQL Community Server 8.4.13 LTS, Oracle's Windows x64 build C:\Program Files\MySQL\MySQL Server 8.4
Service MySQL84, automatic, restart on failure, NT SERVICE\MySQL84 mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.4\my.ini" MySQL84
Network TCP 3306 on every address; no X Protocol (33060) Windows Firewall rules in the group MySQL
TLS Required for every connection, TLS 1.2 and 1.3, this VM's own certificate (RSA 3072, valid 10 years) issued by this VM's own CA C:\ProgramData\MySQL\MySQL Server 8.4\tls
Authentication caching_sha2_password; no RSA key pair, so a password is never accepted without TLS
Accounts root@localhost, admin@'%' (all privileges, REQUIRE SSL)
Defaults utf8mb4 / utf8mb4_0900_ai_ci, max_connections 151, local_infile off, secure_file_priv NULL my.ini
Windows Server 2025 Datacenter, Desktop Experience, build 26100

Filesystem Layout

Path What it holds
C:\Program Files\MySQL\MySQL Server 8.4\ MySQL's programs (bin), libraries and plugins (lib), share, LICENSE and README. Administrators only can change it
C:\ProgramData\MySQL\MySQL Server 8.4\my.ini The server's options
C:\ProgramData\MySQL\MySQL Server 8.4\Data\ The data directory, including the error log mysqld.err. The service account, SYSTEM and Administrators only
C:\ProgramData\MySQL\MySQL Server 8.4\tls\ ca.pem (this VM's CA certificate, for clients), server-cert.pem and server-key.pem
C:\ProgramData\mysql-windows-server-credentials.txt This VM's passwords and certificate fingerprints. SYSTEM and Administrators only
C:\ProgramData\mysql-windows-server-firstboot.log What first boot did (never a password)

Managing the Service

From an elevated PowerShell window:

# restart MySQL
Restart-Service MySQL84

# the server's status and settings
mysqladmin -h localhost -u root -p status
mysql -h localhost -u root -p -e "SHOW GLOBAL VARIABLES LIKE 'require_secure_transport'"

# the end of the error log
Get-Content 'C:\ProgramData\MySQL\MySQL Server 8.4\Data\mysqld.err' -Tail 20

To change a server option, edit C:\ProgramData\MySQL\MySQL Server 8.4\my.ini in an elevated editor (paths in it use forward slashes), then Restart-Service MySQL84.

On Startup

At the first start of your VM, the scheduled task \cloudimg\MySQL first boot (SYSTEM) runs once:

  1. It waits until Azure has finished setting up the VM, with the service stopped and TCP 3306 closed
  2. It creates C:\ProgramData\MySQL\MySQL Server 8.4 and its Data, tmp and tls folders, readable only by SYSTEM, Administrators and the service account
  3. It creates this VM's own certificate authority and server certificate, named for the computer name, localhost and the VM's public and private IP addresses. The CA's private key exists only in memory and is thrown away once it has signed the server certificate
  4. It writes my.ini and creates a new data directory, setting root's password and creating admin with its own password before the server first listens, so there is never an account without a password
  5. It starts the service and checks it: the settings, the accounts, that a missing or wrong password is refused, and that over the VM's own address admin connects with TLS while the same password without TLS is refused
  6. It writes C:\ProgramData\mysql-windows-server-credentials.txt, readable by administrators only
  7. Only then it opens TCP 3306 in Windows Firewall, sets the service to start automatically, writes mysql-windows-server-firstboot.done, and removes itself and its script

If anything fails, the service is left stopped and TCP 3306 closed, and the task tries again at the next start. Every start after that, MySQL starts with Windows. First boot's log:

Get-Content C:\ProgramData\mysql-windows-server-firstboot.log -Tail 10
2026-12-03T06:29:08.4509040Z provisioning finished
2026-12-03T06:29:20.0723732Z service MySQL84 as NT SERVICE\MySQL84, options C:\ProgramData\MySQL\MySQL Server 8.4\my.ini
2026-12-03T06:29:24.2725018Z made C:\ProgramData\MySQL\MySQL Server 8.4 (Data, tmp, tls; SYSTEM, Administrators and NT SERVICE\MySQL84 only)
2026-12-03T06:29:30.1845563Z certificates made: CA sha256=B4A32106D1E72593E4ECED75552F14B6A3AE48CB7564CA52F72F178ECAFB99AF; server CN=<computer name> names=<computer name>,localhost,<private IP>,127.0.0.1,<VM address> sha256=CC0B6DFE70926C139B129B9A5D720A61E045453841F5BEFADD43FF101B121B7D
2026-12-03T06:32:16.6817588Z data directory made (mysqld --initialize-insecure with an init file: root@localhost's password, admin@'%' REQUIRE SSL)
2026-12-03T06:32:27.7667352Z server checked: settings=1 accounts=1 noPw=1 wrongPw=1 remoteTls=1 remoteClear=1 version=8.4.13 requireTls=1 tls=TLSv1.2,TLSv1.3 bind=0.0.0.0 port=3306 mysqlx=0 rsaKey=none localInfile=0 secureFilePriv=NULL charset=utf8mb4 rootSession=TLSv1.3 accounts=admin@%,mysql.infos ...
2026-12-03T06:32:27.7842413Z credentials written (SYSTEM and Administrators only)
2026-12-03T06:32:28.4954822Z Windows Firewall rule cloudimg-MySQL-In (TCP 3306) enabled
2026-12-03T06:32:29.0203759Z service MySQL84 Automatic and running
2026-12-03T06:32:36.3943177Z first boot done

Security Recommendations

  • Keep port 3306 to your own networks. Open it in the network security group only to the addresses of your applications and administrators, and prefer a private network (virtual network peering, VPN) over the internet.
  • Give each application its own account, limited to its own database and, where you can, to its servers' addresses (Step 6). Keep admin for administration.
  • Always connect with VERIFY_IDENTITY (or VERIFY_CA) and this VM's ca.pem. REQUIRED encrypts the connection but does not check who you are talking to.
  • Change the passwords in the credentials file if they have been shared: ALTER USER 'admin'@'%' IDENTIFIED BY '<new password>'; as root.
  • Do not give this VM a managed identity unless you need one. Any program on the VM can reach the Azure Instance Metadata Service (169.254.169.254) and, through it, a managed identity's tokens; MySQL itself is blocked from it.

Maintenance

  • Windows updates: Windows Update is on, as Microsoft ships it. Restarting the VM restarts MySQL automatically.
  • MySQL updates: 8.4 is a long-term support series, so updates within it are bug and security fixes. To update, back up first, stop MySQL84, replace the files in C:\Program Files\MySQL\MySQL Server 8.4 with those of the newer 8.4 Windows x64 archive from dev.mysql.com, and start the service: MySQL upgrades the data directory itself at start-up.
  • Back up your data: mysqldump -h localhost -u root -p --single-transaction --routines --events --all-databases > C:\backup\all.sql, or Azure Backup for the whole VM. Keep the tls folder with your backups if your clients pin this VM's CA.
  • Certificates: this VM's certificates are valid for 10 years. To use your own, replace server-cert.pem and server-key.pem in the tls folder (keeping their permissions), give clients the issuing CA, and restart the service.
  • Firewall: Windows Firewall allows TCP 3306 through cloudimg-MySQL-In; the network security group decides who can reach it.

Troubleshooting

MySQL does not answer, or mysql-windows-server-firstboot.done is missing

First boot may still be running: give it a few minutes and check again. Its log shows how far it got, and the server's own error log says why it stopped:

Get-Content C:\ProgramData\mysql-windows-server-firstboot.log
Get-Content 'C:\ProgramData\MySQL\MySQL Server 8.4\Data\mysqld.err' -Tail 30

ERROR 3159 or ERROR 1045 from a client that worked elsewhere

The server requires TLS. Connect with --ssl-mode=VERIFY_IDENTITY --ssl-ca=ca.pem (or at least --ssl-mode=REQUIRED). A client that sends the password only after asking for the server's RSA key does not work here: this image offers no RSA key, so use TLS.

ERROR 2026: SSL connection error, or the certificate does not match

With VERIFY_IDENTITY the host name you connect to must be one the certificate names: the VM's public or private IP address, its computer name or localhost. If you connect through a DNS name, replace the certificate with one for that name (Maintenance), or use VERIFY_CA.

root cannot sign in from my computer

That is by design: root signs in from the VM only. Use admin, or an account of your own.

Forgot the Windows password

Use Reset password on the VM's page in the Azure portal.

Support

cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours. Contact support@cloudimg.co.uk.

MySQL is a trademark of Oracle Corporation and/or its affiliates, used here to describe the software. cloudimg is not affiliated with or endorsed by Oracle; the software is provided under its open source licence (GPL-2.0). Microsoft and Windows Server are trademarks of the Microsoft group of companies.