Skip to main content
Mythic Framework uses a dual-database architecture: MongoDB for game data and authentication, and MySQL for compatibility and relational data. This guide walks you through setting up both databases.

Database Architecture Overview

MongoDB (Primary)

Stores:
  • User accounts and authentication
  • Character data
  • Inventory and items
  • Player-specific data
  • Logs and analytics
Why: Fast, flexible, document-based storage perfect for game data

MySQL (Secondary)

Stores:
  • Relational data
  • Compatibility with other resources
  • Persistent server data
  • Structured records
Why: Industry standard, excellent for structured data and compatibility
Both databases are required. Mythic Framework will not start without both MongoDB and MySQL properly configured.

MongoDB Setup

MongoDB databases (auth and fivem) are created automatically by Mythic Framework on first start. No manual database creation is required.

MongoDB Connection String

The connection string tells Mythic Framework how to connect to MongoDB. Format:
Examples:
Security Warning: Never use no-authentication setup in production! Always enable authentication for production servers.
For production servers, enable authentication:
Enable authentication in MongoDB config:
Edit C:\Program Files\MongoDB\Server\6.0\bin\mongod.cfg:
Restart MongoDB service:

Test MongoDB Connection

Verify you can connect with your configured credentials:

MySQL Setup

Create Database

Create the MySQL database for Mythic Framework:
The database name MythicFramework_345AE9 can be customized, but make sure it matches your server.cfg configuration.

MySQL Connection String

The connection string format for oxmysql: Format:
Examples:

Test MySQL Connection

Verify your connection works:

Configure server.cfg

Now update your server.cfg with the database connection strings. Open server.cfg and find the database configuration section:
server.cfg
Update with your actual connection strings:
Important:
  • Replace your_password / your_secure_password with your actual passwords
  • Do NOT use root MySQL user in production
  • Keep passwords secure and never commit server.cfg to public repositories

Verify Database Configuration

Let’s verify the databases are configured correctly before starting the server.

MongoDB Verification

1

Check MongoDB is running

2

Check databases exist

3

Test connection string

MySQL Verification

1

Check MySQL is running

2

Check database exists

3

Test connection string

Database Initialization

On first server start, Mythic Framework will automatically:
  1. Connect to both databases
  2. Create required collections (MongoDB)
  3. Create required tables (MySQL)
  4. Initialize default data
  5. Create indexes for performance
You don’t need to manually create tables or collections. The framework handles this automatically on first run.

Connection Troubleshooting

Common Issues:
  1. MongoDB not running:
  2. Wrong connection string:
    • Check username/password
    • Verify authSource=admin if using authentication
    • Ensure database names match
  3. Authentication error:
  4. Firewall blocking:
Common Issues:
  1. MySQL not running:
  2. Wrong credentials:
  3. Database doesn’t exist:
  4. Host/port issues:
  5. User doesn’t have privileges:
If oxmysql won’t start:
  1. Check connection string format is correct
  2. Verify resource exists: resources/oxmysql/
  3. Ensure it’s started before mythic-base in resources.cfg
  4. Check console for specific error messages

Database Management Tools

MongoDB Compass

Best for:
  • Viewing character data
  • Debugging inventory issues
  • Analyzing player statistics
  • Running queries
Connect: mongodb://localhost:27017

HeidiSQL / phpMyAdmin

Best for:
  • Viewing relational data
  • Debugging SQL queries
  • Analyzing performance
  • Managing users
Connect: localhost:3306

Security Best Practices

  • Minimum 16 characters
  • Mix of uppercase, lowercase, numbers, symbols
  • Don’t use default passwords
  • Don’t reuse passwords from other services
  • Only allow localhost connections if server and database are on same machine
  • Use firewall rules to restrict database ports
  • Never expose database ports to the internet
  • Use VPN for remote database access
  • Daily automated backups
  • Test restore procedures
  • Keep backups off-site or in cloud storage
  • Backup before major updates
  • Set up monitoring for connection errors
  • Monitor disk space usage
  • Track slow queries
  • Set up alerts for unusual activity

Next Steps

Databases are configured! Now configure the rest of your server:

Server Configuration

Configure server.cfg with license keys and settings

First Start

Start your server for the first time
Before starting the server: Double-check both MongoDB and MySQL are running and connection strings in server.cfg are correct. This prevents 90% of startup issues.