Skip to main content
Mythic Framework uses a dual-database architecture: two MongoDB databases (Auth and Game) plus MySQL via oxmysql.

Database Requirements

MongoDB

Version: 3.6.6 or higher Purpose: Primary database — two separate databases for auth and game data Required: YES

MySQL

Version: 5.7 or higher (MariaDB 10.2+) Purpose: Inventory persistence, compatibility layer Required: YES

MongoDB Configuration

Mythic requires 4 separate convars for two MongoDB databases:
Two separate MongoDB databases are required. The auth database stores accounts and bans. The fivem database stores characters, vehicles, inventory, properties, and all game data.

Basic Connection (Development)

Authenticated Connection (Production)

Both databases can share the same MongoDB server and credentials — they are just different database names within the same MongoDB instance.
Remote Server:
MongoDB Atlas (Cloud):
Atlas uses mongodb+srv:// protocol for automatic DNS resolution. The database name is set separately via the mongodb_auth_database and mongodb_game_database convars.

What Each Database Stores

Database name: auth

Creating MongoDB User

1

Connect to MongoDB

2

Switch to Admin Database

3

Create User with Access to Both Databases

4

Verify Connection

MongoDB Troubleshooting

Error: MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017Solutions:
Error: MongoError: Authentication failedSolutions:
  • Verify credentials are correct
  • Ensure authSource=admin is in the connection string
  • Verify user has roles for both auth and fivem databases:
MongoDB creates databases automatically on first write. The auth and fivem databases will be created when the framework first starts and inserts data.

MySQL Configuration

Connection String

Mythic uses oxmysql with a standard MySQL connection string:
The default database name is MythicFramework. Always use charset=utf8mb4 for proper character support.

Connection String Components

Common Configurations

Slow Query Warning

oxmysql can warn you about slow queries:

Creating MySQL Database and User

MySQL Troubleshooting

Error: Access denied for user 'username'@'host'
  • Verify username and password
  • Check user exists: SELECT User, Host FROM mysql.user;
  • URL-encode special characters in passwords:
Error: Unknown database 'MythicFramework'Create it:
Increase MySQL max connections:
Or reduce oxmysql connection limit in the connection string:

Complete server.cfg Example

Production Checklist

1

MongoDB

  • Authentication enabled with strong password
  • User has readWrite + dbAdmin roles on both auth and fivem
  • Connection strings include authSource=admin
  • Firewall configured (port 27017)
  • Regular backups configured
2

MySQL

  • Strong password set (not root with no password)
  • User limited to MythicFramework database
  • utf8mb4 charset used
  • Firewall configured (port 3306)
  • Regular backups configured
3

server.cfg

  • All 4 MongoDB convars set
  • MySQL connection string configured
  • Credentials not committed to git

Next Steps

Server Configuration

Complete server.cfg settings guide

Database Architecture

Learn how Mythic uses databases internally

Resource Management

Configure resource load order

Troubleshooting

Common setup issues and fixes