How to Install MariaDB on Windows - Complete Setup Guide
Why MariaDB for Game Servers
MariaDB is an open-source fork of MySQL that's faster, more secure, and completely compatible with MySQL tools and queries. For game servers: FiveM ESX and QBCore frameworks require MySQL/MariaDB for player data, jobs, vehicles, and inventory storage. Minecraft server networks use MariaDB for shared permissions (LuckPerms), economy (EssentialsX), and cross-server data syncing. MariaDB is free (GPL license), actively maintained, and performs 5-15% better than equivalent MySQL versions for game server workloads due to optimized query execution. It works with all standard MySQL tools: HeidiSQL, phpMyAdmin, MySQL Workbench, and the mysql command-line client. For most game server use cases, MariaDB is the recommended database choice.
Downloading MariaDB
Go to mariadb.org/download on your Windows VPS or server. Select Windows as your operating system. Choose the MSI installer (recommended for easy setup) or ZIP package (for manual installation). Download the latest stable version (11.x series as of 2026). For production servers, choose the Long Term Support (LTS) version for maximum stability - it receives security updates for 5+ years. The installer is approximately 100-150MB. If downloading on your local machine to transfer to a VPS, use the MSI installer directly on the VPS via RDP for easier setup.
Installation Steps
1) Run the downloaded MSI installer. 2) Click Next through the welcome screen and accept the license agreement. 3) Choose components: select MariaDB Server (required), HeidiSQL (recommended for database management), and optionally the command-line tools. 4) Set the root password - this is your main database administrator password. Use a strong password (12+ characters, mix of letters/numbers/symbols) and save it securely. 5) Keep default port 3306 unless this conflicts with another MySQL installation. 6) Choose UTF8MB4 as the default character set (supports emojis and all languages). 7) Install as a Windows Service - this makes MariaDB start automatically on boot. Choose 'Install as service' and set Service Name to 'MariaDB'. 8) Enable 'Enable networking' and 'Enable TCP/IP access' if your game server connects from a different machine. 9) Click Install and wait 2-3 minutes for completion. 10) Once installed, HeidiSQL opens automatically - test the connection with your root password to verify the installation succeeded.
Configuration & Security
After installation, secure your MariaDB: 1) Open Windows Firewall: if your game server is on the same machine, MariaDB only needs localhost access (127.0.0.1) - no firewall changes needed. If connecting from a separate game server machine, add an inbound rule allowing port 3306 from the game server's IP address only. 2) Remove default test database and anonymous users using HeidiSQL or command line: DROP DATABASE test; DELETE FROM mysql.user WHERE User=''; FLUSH PRIVILEGES; 3) Create dedicated databases for your game server: CREATE DATABASE fivem_esx; for ESX, CREATE DATABASE fivem_qbcore; for QBCore. 4) Create dedicated users per application: CREATE USER 'fivem'@'localhost' IDENTIFIED BY 'strongpassword'; GRANT ALL PRIVILEGES ON fivem_esx.* TO 'fivem'@'localhost'; - never use the root account for game server connections. 5) For backup: use mysqldump from command line or set up Windows Task Scheduler to run daily database exports.
Connecting from Game Servers
For FiveM ESX servers: in server.cfg, add: set mysql_connection_string "server=127.0.0.1;database=esx_db;user=fivem_user;password=yourpass". For QBCore servers: same connection string format in server.cfg. For OX MySQL (modern FiveM): set oxmysql_connection_string "mysql://user:[email protected]/database?charset=utf8mb4". For Minecraft servers with MySQL plugins: each plugin (LuckPerms, EssentialsX, CoreProtect, BanManager) has its own config file with host, port, database, user, and password fields. Host should be 127.0.0.1 if MariaDB is on the same machine. If your game server and database are on separate machines: use the database server's IP address and ensure the firewall allows port 3306 from the game server's IP. Test connection: connect with HeidiSQL using the game server's credentials to verify. Common error 'Access denied' means the user doesn't have permission to that database - check the GRANT statement.
Maintenance & Optimization
Weekly maintenance: OPTIMIZE TABLE tablename; on frequently modified tables (inventories, vehicles, user data). This reclaims disk space and improves query speed. Monitor disk space: game server databases grow over time - a 64-slot FiveM server can accumulate 500MB-2GB of database data over months. Set up scheduled backups: create a Windows Task Scheduler task that runs mysqldump daily at off-peak hours. Example command: "C:\Program Files\MariaDB\bin\mysqldump.exe" -u root -pYourPassword --all-databases > "C:\Backups\mariadb_backup_%date%.sql". Keep 7 days of backups. Upgrade MariaDB: download the new MSI installer, run it - it detects the existing installation and performs an in-place upgrade. Always back up before upgrading. For game servers, MariaDB on NVMe storage provides 5-7x faster database queries than on SATA SSD - important for FiveM servers where every player join queries the database. CyberNex VPS plans include NVMe storage by default.
FAQ
Related Tutorials
Was this guide helpful?
Join our Discord for more guides and direct help from our engineering team.
