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:

  1. Log in to your game panel
  2. Select your FiveM Server
  3. Navigate to the "Databases" tab
  4. Click on "New Database" and type a name

Steps To Connect Your Database To Your FiveM Server:

  1. Go to the server console and stop the server
  2. Make sure you have the latest version of oxmysql installed on your server
  3. In your server's server.cfg file, insert the following line:
    "set mysql_connection_string server=Host;uid=username;password=Password;database=Database"
  4. 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:

  1. Double-check that your username, password, database name, and host are correct
  2. Make sure there are no typos or extra spaces in the connection string
  3. 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!

Was this answer helpful? 0 Users Found This Useful (0 Votes)