How to Configure Your Database String for FiveM or RedM

Support / FiveM / Setup / How to Configure Your Database String for FiveM or RedM
FiveM Icon
Create a FiveM Server today!
Start Free Trial

In this guide, we will show you how to set up your database string for your Nodecraft server. Certain games we host, such as FiveM and RedM, require database configuration. We’ll walk you through enabling your database, understanding the database information tab, and adding the database string to your server files.

Note: FiveM and RedM use MariaDB, while other games we host typically use MySQL. PhpMyAdmin is a web tool that can be used to manage either type of database for our games.

Setting Up Your Database

  1. Navigate to your FiveM or RedM server panel.

  2. Select the Databases tab on the left side of the panel.

  3. Click Create Database.

to create a database

4. The Database is created.

Adding Your Database String to Your Server

  1. In the Databases tab, click Show.

  2. Take note of the following details needed to create your database string:

    • Database Username

    • Database Password

    • Database Hostname

    • Database Port

    • Database Name

  3. Locate your server.cfg file.

    • For TxAdmin directory: /servers/FiveMBasicServerCFXDefault_3535C0.base

  4. Select server.cfg file then Edit.

  5. Using the database information, create your database string using the following format:

set mysql_connection_string "user=databaseusername;password=databasepassword;host=databasehostname;port=databaseport;database=databasename"

Note Following this naming convention: set mysql_connection_string “user=database username;password=databasepassword;port=databaseport;database=databasename”

Example:

set mysql_connection_string "user=np2_E79_ba5dAucr;password=JveygaTCWzZ6xBbYC62dPh5;host=localhost;port=3306;database=np2_kNTS5njW3EGB0lRsIr"

6. Select Save.

7. Start your server.

Troubleshooting

If your server is still having issues connecting to the database, try the following:

  • Ensure you restart the server after making changes. Changes made while the server is online may not save properly.

  • Double-check that your database string follows the correct setup formula.

  • Verify you haven’t accidentally mixed-up Database Name and Database Hostname. The Database Name is usually longer, while the Hostname may start similarly but is shorter.

Conclusion

Configuring your database string correctly is essential for your server to function properly, especially for games like FiveM and RedM. By following this guide, you should now be able to create a database, gather the necessary credentials, and properly insert the database string into your server.cfg file. Always double-check your entries and restart the server after making changes to ensure everything works smoothly. Once configured, your server will be ready to run with a fully operational database connection.

Need Help?

If you have questions or run into any issues, our support team is here to help! Reach out using the support widget on our website or visit our support center for further assis

Need Help?

If you have questions or run into any issues, our support team is here to help! Reach out using the support widget on our website or visit our support center for further assistance.