- Joined
- May 10, 2025
- Messages
- 54
- Thread Author
- #1
MariaDB is a powerful, open-source drop-in replacement for MySQL. It’s secure, fast, and widely supported. This guide walks you through installing and configuring MariaDB on a Linux server (Ubuntu/Debian-based).
Requirements
- A Linux VPS or Dedicated Server (Ubuntu 20.04 or newer recommended)
- Root or sudo access
- Basic knowledge of terminal/SSH
Step 1: Update Your System
Bash:
sudo apt update && sudo apt upgrade -y
Step 2: Install MariaDB Server
Bash:
sudo apt install mariadb-server -y
To check status:
Bash:
sudo systemctl status mariadb
Step 3: Secure Your MariaDB Installation
Run the built-in security script:
Bash:
sudo mysql_secure_installation
- Set root password: Yes
- Remove anonymous users: Yes
- Disallow root login remotely: Yes
- Remove test database: Yes
- Reload privileges: Yes
Step 4: Basic Configuration
Login to MariaDB shell:
Bash:
sudo mariadb -u root -p
SQL:
CREATE DATABASE hracedb;
CREATE USER 'hraceuser'@'localhost' IDENTIFIED BY 'strongpassword';
GRANT ALL PRIVILEGES ON hracedb.* TO 'hraceuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Step 5: Enable and Start MariaDB
Ensure MariaDB runs on boot:
Bash:
sudo systemctl enable mariadb
sudo systemctl start mariadb
Step 6: (Optional) Remote Access Setup
To allow remote access:- Edit the config:
Bash:
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf - Change bind address:
Code:
bind-address = 0.0.0.0 - Restart mariadb:
Bash:
sudo systemctl restart mariadb - Allow port 3306 on your firewall:
Code:
sudo ufw allow 3306
Step 7: Test the Connection
Use a local or remote MySQL client to test:
Bash:
mysql -u user -p -h <your-server-ip> db
Tips
- Use fail2ban or iptables to secure remote access
- Backup databases regularly with mysqldump
- Use strong passwords for all DB users
References
- MariaDB Docs
- DigitalOcean MariaDB Guide
Need Help?
Post your issue or configuration snippet at
Private Server Development Community
A community for developing and running gaming private servers. Share tools, scripts, mods, and ideas. Connect with devs and players to build unique, custom online gaming experiences together.
hrace009.com