MariaDB is a MySQL-compatible relational database that provides enhanced features, better performance, and additional storage engines. It’s a drop-in replacement for MySQL created by the original MySQL developers.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dokploy/dokploy/llms.txt
Use this file to discover all available pages before exploring further.
Creating a MariaDB Database
Navigate to Databases
In your Dokploy dashboard, select your environment and click Add Database > MariaDB.
Configure Basic Settings
Provide the basic information:
- Name: Display name for your database
- App Name: Internal DNS name (e.g.,
mariadb-prod) - Description: Optional notes
- Docker Image: MariaDB version (default:
mariadb:6)
Connection Information
- Internal Connection
- External Connection
- Root Access
Applications in the same environment connect via internal DNS:Connection String Examples:
Configuration
Environment Variables
Customize MariaDB with environment variables:Resource Allocation
Recommended resources by workload:| Workload | Memory Reservation | Memory Limit | CPU Reservation | CPU Limit |
|---|---|---|---|---|
| Development | 128MB | 256MB | 0.1 | 0.25 |
| Small Application | 256MB | 512MB | 0.25 | 0.5 |
| Production | 512MB | 2GB | 0.5 | 1.0 |
| High Performance | 1GB | 4GB | 1.0 | 2.0 |
Docker Image Versions
MariaDB version options:MariaDB uses a different versioning scheme than MySQL. Version 10.x is compatible with MySQL 5.x/8.x.
Database Operations
Lifecycle Management
- Start/Stop
- Reload
- Rebuild
Control database availability:Start: Brings database online
- Status changes to
done - Accepts connections
- Loads from persistent volume
- Status changes to
idle - Closes all connections
- Data persists in volume
- No resource consumption
Volume Management
MariaDB stores data in a Docker volume:- Database files (
.ibd,.frm) - InnoDB tablespace
- Aria storage engine files
- Binary logs
- Configuration
Backup Configuration
See Database Backups for automated backup setup.Advanced Configuration
Custom Startup Configuration
Command:Health Check Setup
Monitor and auto-recover MariaDB:Restart Policy
Automatic restart configuration:MariaDB-Specific Features
MariaDB includes features not available in MySQL:Storage Engines
Additional storage engines:- Aria: Crash-safe MyISAM replacement
- ColumnStore: Columnar storage for analytics
- Spider: Sharding and partitioning
- Connect: Access external data sources
JSON Support
Enhanced JSON capabilities:Temporal Tables
Built-in time travel queries:Common Use Cases
- Web Application
- Analytics
- Replication Source
Standard MariaDB for web apps:
Monitoring and Logs
View MariaDB logs in real-time:- Open your MariaDB service
- Navigate to Logs tab
- Monitor activity and errors
Troubleshooting
Initialization failed
Initialization failed
Check logs for initialization errors:Common issues:
- Invalid password format (special characters)
- Insufficient disk space
- Corrupted existing data directory
- Permission issues on volume
- Verify password meets requirements
- Check available disk space
- Delete and recreate if needed
Cannot connect
Cannot connect
Verify connection configuration:
- Host: Use app name internally
- Port: 3306 internal, custom external
- Status: Must be
done - Network: Same environment for internal
Performance issues
Performance issues
Optimize MariaDB configuration:
-
Increase memory:
-
Enable query cache:
-
Tune table cache:
-
Check slow queries:
Out of memory
Out of memory
Reduce memory usage:
- Increase container memory limit
- Reduce buffer pool:
- Limit connections:
- Disable query cache:
Migration
From MySQL to MariaDB
MariaDB is generally compatible with MySQL:- Backup MySQL data using mysqldump
- Create MariaDB database in Dokploy
- Restore data to MariaDB
- Update connection strings in applications
- Test thoroughly for compatibility
- Most MySQL features work unchanged
- Authentication differences in newer versions
- Some optimizer behaviors differ
- Extended features available in MariaDB
Version Upgrades
Upgrade MariaDB versions:- Backup database (important!)
- Update Docker image version
- Redeploy database
- Verify operation and data integrity
- Run mysql_upgrade if needed
Next Steps
Setup Backups
Configure automated MariaDB backups
MongoDB
Deploy a MongoDB database