How to Create a MySQL Database and Connect It to Your FiveM Server
Learn how to create a MySQL database in the DazcoHost panel and connect it to your FiveM server via oxmysql in server.cfg.
How to Create a MySQL Database and Connect It to Your FiveM Server
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
mysql_connection_string
in your server.cfg file.
Steps to Create a Database on Your Server
- Log in to your DazcoHost 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.cfgfile, 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.
Need more help?
Search the help center or reach our team directly, we reply in about 10 minutes.