Installing MariaDB Server on Windows provides a local, reliable SQL backend for development and testing, avoiding “works on one machine” surprises when an app expects a database.

On Windows, MariaDB is commonly deployed using the official .msi installer, which can install the server, client utilities (mariadb.exe/mysql.exe, mysqldump.exe), and optionally create a Database instance backed by a data directory under the installation root.

Administrative privileges are required to register the Windows service and write under Program Files, and the installer prompts for security-sensitive settings like the root password, remote root access, and whether TCP/IP networking is enabled on port 3306.

Steps to install MariaDB server on Windows:

  1. Download the MariaDB Community Server .msi installer.
    https://mariadb.org/download/

    Select Operating System: Windows and download the x64 .msi package.

  2. Run the downloaded .msi installer as administrator.
  3. Click Next on the Welcome screen.
  4. Accept the license agreement and click Next.
  5. Keep Database instance enabled in Custom Setup and click Next.

    Default data directory location is data under the installation root unless changed in the feature tree.

  6. Choose the installation directory and click Next.

    Default path is typically C:\Program Files\MariaDB <version>\.

  7. Set a strong root password, keep the anonymous account disabled, and disable remote root access.

    Enabling remote root access expands attack surface and increases the blast radius of a leaked password.

  8. Enable Install as service and keep the service name set to MariaDB.

    In MariaDB 10.4+ MSI installs, the default service name is MariaDB.

  9. Enable Networking and keep the port set to 3306.

    Remote clients require a Windows firewall rule for port 3306 and explicit GRANTs for non-local hosts.

  10. Start the installation by clicking Install.
  11. Exit the installer by clicking Finish.
  12. Open Command Prompt.
  13. Confirm the MariaDB service is running.
    C:\> sc query MariaDB
    
    SERVICE_NAME: MariaDB
            TYPE               : 10  WIN32_OWN_PROCESS
            STATE              : 4  RUNNING
                                    (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
            WIN32_EXIT_CODE    : 0  (0x0)
            SERVICE_EXIT_CODE  : 0  (0x0)
            CHECKPOINT         : 0x0
            WAIT_HINT          : 0x0

    Replace MariaDB with the configured service name when a custom name was set in the installer.

  14. Print the installed client version.
    C:\> "C:\Program Files\MariaDB 12.1\bin\mariadb.exe" --version
    mariadb  Ver 15.1 Distrib 12.1.2-MariaDB, for Win64 (AMD64)

    Replace the version segment in the path when a different MariaDB version or install directory is used.

  15. Connect to the local server as root over TCP.
    C:\> "C:\Program Files\MariaDB 12.1\bin\mariadb.exe" --user=root --password --host=127.0.0.1 --port=3306
    Enter password: ********
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 8
    Server version: 12.1.2-MariaDB MariaDB Server
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  16. Verify server responsiveness by querying the server version.
    MariaDB [(none)]> SELECT VERSION();
    +----------------+
    | VERSION()      |
    +----------------+
    | 12.1.2-MariaDB |
    +----------------+
    1 row in set (0.00 sec)
  17. Create a dedicated database and local user for applications.
    MariaDB [(none)]> CREATE DATABASE appdb;
    Query OK, 1 row affected (0.01 sec)
    
    MariaDB [(none)]> CREATE USER 'appuser'@'localhost' IDENTIFIED BY 'StrongPassword!ChangeMe';
    Query OK, 0 rows affected (0.01 sec)
    
    MariaDB [(none)]> GRANT ALL PRIVILEGES ON appdb.* TO 'appuser'@'localhost';
    Query OK, 0 rows affected (0.01 sec)
    
    MariaDB [(none)]> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.00 sec)

    Using a dedicated user avoids running application connections with full root privileges.

  18. List configured root account host entries.
    MariaDB [(none)]> SELECT User, Host FROM mysql.user WHERE User='root';
    +------+-----------+
    | User | Host      |
    +------+-----------+
    | root | localhost |
    | root | 127.0.0.1 |
    | root | ::1       |
    +------+-----------+
    3 rows in set (0.00 sec)
  19. Confirm anonymous accounts are absent.
    MariaDB [(none)]> SELECT User, Host FROM mysql.user WHERE User='';
    Empty set (0.00 sec)
  20. Confirm the test database is absent.
    MariaDB [(none)]> SHOW DATABASES LIKE 'test';
    Empty set (0.00 sec)
  21. Exit the MariaDB client.
    MariaDB [(none)]> exit
    Bye
Discuss the article:

Comment anonymously. Login not required.