How to import SQL to database?

🧭 Step-by-Step Guide

In this example, we’ll use HeidiSQL, one of the most popular database management tools. (You can also use phpMyAdmin or any other database tool you prefer.)


💡 Important Tip

Avoid importing the same .sql file more than once. If you’re unsure, check whether the table already exists in your database before proceeding.


1. Open your database tool

Launch HeidiSQL, select your saved connection (which should already be configured), and click Open to connect to your MySQL server.


2. Select your database

In the left panel, you’ll see a list of available databases. Click on the database used by your server (commonly named something like fivem or esx_legacy).


3. Open the Query tab

Once your database is selected, click the Query button (▶️) in the top toolbar. This will open a blank editor where you can paste SQL code.


4. Import the .sql file

Open the .sql file (using Notepad or any code editor), copy all of its contents, and paste them into the Query tab in HeidiSQL.

If the resource includes multiple .sql files (for example, items.sql, jobs.sql, etc.), repeat this step for each file.


5. Execute the query

Click the Execute SQL button (▶️ play icon) or press F9. If everything runs correctly, HeidiSQL will display a success message at the bottom. ✅ Done! Your database is now ready.

Last updated