This guide explains how to create a MySQL database and connect it to your FiveM server. Databases are required for storing player data, inventories, vehicles, and other persistent information. Below you will find step-by-step instructions on creating a database and connecting it using the mysql_connection_string in your server.cfg file.
Steps To Create A Database On Your Server:
- Log in to your game panel
- Select your FiveM Server
- Navigate to the "Databases" tab
- Click on "New Database" and type a name
Steps To Connect Your Database To Your FiveM Server:
- Go to the server console and stop the server
- Make sure you have the latest version of oxmysql installed on your server
- In your server's server.cfg file, insert the following line:
"set mysql_connection_string server=Host;uid=username;password=Password;database=Database" - Change the details in the connection string to match your actual database credentials (you can find them under the "Databases" tab)
Troubleshooting:
If your FiveM server cannot connect to the database:
- Double-check that your username, password, database name, and host are correct
- Make sure there are no typos or extra spaces in the connection string
- Ensure that oxmysql is properly installed and started in your server.cfg
For any more assistance, feel free to contact us on Discord or the Website.
Our custom panel has a wide variety of exclusive features that make editing and managing game servers a breeze.
All game servers come with powerful hardware and a dedicated team of support members to help you build the servers exactly the way you want.
Start your FiveM server hosting journey today with Pine Hosting!
