.sql file that creates their database tables. To import it with HeidiSQL, connect using the HOST, USER NAME and PASSWORD from the database card on Databases, select your database on the left, export a backup first, then choose File > Run SQL file and pick the .sql file. Restart the server afterwards.
Before you start
- A database on your server. See how to set up a FiveM database.
- Allowed to connect from on the database card set to Anywhere, so HeidiSQL can reach it from your computer.
- HeidiSQL installed from heidisql.com.
How to connect HeidiSQL to your FiveM database
1
Copy the details
Open your server in the Game Panel, click Databases and click Show next to the password on your database card.
2
Create a new session in HeidiSQL
Open HeidiSQL and click New in the session manager. Choose a MariaDB or MySQL (TCP/IP) network type.
3
Enter the details
Fill in the hostname (the IP part of HOST, for example
203.0.113.10), the port 3306, the user and the password from the card.4
Connect
Click Open. Your database appears in the list on the left.
How to import a .sql file
1
Back up the database first
Many
.sql files drop and recreate tables, which deletes their data. Export a copy of the database before you import, for example with Export database as SQL in HeidiSQL or Export in phpMyAdmin.2
Select your database
Click your database in the list on the left, so the file runs in the right place.
3
Run the SQL file
Choose File > Run SQL file and pick the script’s
.sql file. Wait until HeidiSQL finishes.4
Restart the server
Restart your FiveM server so the script sees its new tables.
Which order should I import SQL files in?
Import the framework’s file first (for example the QBCore or ESX.sql), then the files of the scripts that build on it. A script’s tables often refer to the framework’s tables, so the other way round can fail.
Frequently asked questions
Why can’t HeidiSQL connect to my database?
Check the host IP, port3306, user name and password on the card. Allowed to connect from must be Anywhere (or your own IP if you chose One address only). If you clicked Rotate password, use the new password.
I get “table already exists”. What now?
The script’s tables are already there, often from a txAdmin recipe. Check the script’s instructions before you run the file again, and back up first.Can I import a whole database from another host?
Yes. Export it as a.sql file on the old host, then run it on your new database with the steps above. Update the mysql_connection_string in server.cfg with the details from your new card.
Is my database included in server backups?
Export the database yourself before big changes. Deleting a database on Databases removes all its data, and no backup of it is kept.Related guides
FiveM server guide
Every FiveM guide in one place.
Set up a FiveM database
Create the database and oxmysql string.
Install QBCore or ESX
Frameworks and their SQL.
Install mods and resources
Upload the script itself.
Manage databases
Every option on the Databases page.
Tested by the FREAKHOSTING team on our Game Panel on 29 October 2026 (FXServer build 35245 (Recommended) with txAdmin). HeidiSQL menu names checked against the HeidiSQL help. Steps may differ slightly in other HeidiSQL versions.
Need Extra Help?
If you encounter any issues, our support team is ready to assist:- Live Chat: Quick assistance via our website.
- Support Ticket: Open a Ticket
- Discord: Join our Community
- Email: support@freakhosting.com
Last Updated: October 2026