How to import SQL to database?
Some scripts come with .sql
files. These are important - they create the necessary database tables for the resource to work properly.
Here's how to import them into your server’s database:
🧭 Step-by-step guide
In this example, we'll use HeidiSQL, one of the most common database tools. (You can also use phpMyAdmin or any other database tool of your choice.)
💡 Tips
Don't import the same file twice - if you're unsure, check if the table already exists.
1. Open your database tool
Launch HeidiSQL, select your saved connection (you should already have it set up), and click Open to connect to your MySQL server.
2. Select your database
On the left side, you'll see a list of databases.
Click the one your server uses (commonly named something like fivem
, esx_legacy
).
3. Open the Query tab
When you go to your database, the button ▶️ Query is available on the header. A blank editor will open where you can paste SQL code.
4. Upload the .sql file
Open the .sql
file (e.g. with Notepad or any code editor), copy everything, and paste it into the SQL tab in HeidiSQL.
5. Click Execute
Click the Execute SQL button at the top (▶️ play icon), or press F9. HeidiSQL will run the code and show a success message at the bottom if everything went fine.
✅ Done! Your database is now ready.
Last updated
Was this helpful?