How to add and connect the fx server to the Database and how to connect to the database using heidisql software

Creating a database through the game server at the end of the instructions

Get started by downloading Heidisql and XAMPP 

https://www.heidisql.com/download.php?download=installer / HeidiSQL

https://www.apachefriends.org/download.html/ XAMPP

 

1.If you have ordered an FX server, follow instruction 1.1

If your server is installed in a Windows environment, follow instruction 2.1

1.1 FX SERVER GUIDE

Open Databases tab

Click "New DATABASE"

Enter a name for your Database and leave Connections FROM empty

Here is your database connection information.

  • Endpoint : database ip
  • Username : database username
  • EYE : show password
  • Trashcan : delete database

And finally connect to this Database HeidiSQL. In the lower left corner, click "new" and enter your database information.

After that, start following the 3. step

WINDOWS GUIDE

2. Start both, turn on MySQL from XAMPP, after HeidiSQL press "new"

Hostname / IP: Enter the server address (e.g. localhost if you are using a local database).
User: Enter the user name (e.g. root).
Password: Enter the password.
Port: Leave as default (3306) or change as needed.


3.Click on an empty space with the right mouse button and create a new database, let's name it "server"

 

4. Now it should appear in the list on the left.

3. Next, you need the mysql-async file from github

https://github.com/brouznouf/fivem-mysql-async/releases

Download mysql-async for yourself

Once you have downloaded this to yourself, extract it in the downloaded files (right mouse click "unpack all")

4. Move the mysql-async file you downloaded to the "resources" folder of your server. 

5.Open the server.cfg file, for example, in Notepad or another text editor.

Change sv_licenseKey to your own FiveM license key.
Add the resources your server is using.
Set the database connection information correctly.

6. How to verify server.cfg is loading?

When you start FXServer (e.g. via run.cmd), the server should automatically read the server.cfg file. The console displays a message about the loaded resources and settings.

If the configuration file is not found, FXServer will not start correctly.

 

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