New guide on how to install and setup mysql for fivem. Here I’ll explain how to install MySQL and SQLite. Without any further ado let’s get started!
Requirements
In order, to setup a mysql server and connect it to a fivem server you need to have a running fivem server. If you don’t have one read this guide if you are using windows, or this one if you are on linux.
Installing MySQL
First of all, let’s talk about how to install a MySQL server, and HeidiSQL, which is an application to connect to databases. There are a lot of ways to install and use a basic MySQL server, but I like to keep things simple. That’s the reason why I personally use XAMPP. You can install it here. The installation is pretty simple just download the file and if it asks you to add to PATH or similar stuff check it. You’re gonna have an easier life. Once you’ve downloaded it open xampp and you are gonna have an UI like this:
Here on the same row of MySQL click start. You can even start apache which can be used with MySQL to open PHPMyAdmin. A website where you can basically change all of your databases.
To install heidisql open this link and download the executable. While installing it, check all those options like “associate .sql files” or “add to PATH”, to have an easier life.
Installing SQLite
SQLite is not the best thing to install. Yes, it is lighter, and faster, but has some vulnerabilities. Anyway to install it, click here and download the latest stable version and proceed to install it.
Connecting MySQL to fivem server
In order to fully setup mysql server and connect it to a fivem server you need to install mysql-async and open the server.cfg and put this string at the beginning:
set mysql_connection_string "server=127.0.0.1;database=databaseName;userid=username;password=passowrd"
And this is it. The setup of a mysql server and connection to a fivem server is over, make sure to stay toned. Don’t forget to join our discord server here and good luck with your server.