New

EmeraldHost 2.0 is here: faster, more intuitive, and made for everyone - the new panel!

Learn more
Guides
How to Import an .sql File Into Your FiveM Server Database
FiveMFiveMImport Database

How to Import an .sql File Into Your FiveM Server Database

Import an SQL file into your FiveM server database using phpMyAdmin

4 min read
Aug 7, 2026

Many FiveM frameworks and scripts ship with an .sql file that creates all the tables they need. You load this file into your database using phpMyAdmin.

Before you start

  1. Stop the server
    Stop your server via the dashboard. That way no resource writes to the database while the import is running.

  2. Review the SQL file
    Open the .sql file in a text editor and check whether it contains lines such as CREATE DATABASE or USE.

  3. Watch out for overwritten tables
    Also check the file for lines containing DROP TABLE IF EXISTS. Existing tables with the same name are deleted along with their content during the import. Back up your data beforehand.

Back up existing tables

If your database already holds data, export it before importing.

  1. Open phpMyAdmin
    In the dashboard, go to Databases and click the external icon next to your database, then log in.

  2. Select the database
    Click your database in the left sidebar.

  3. Open the Export tab
    Click Export at the top.

  4. Download the export
    Leave the Export method on Quick - display only the minimal options and the Format on SQL. Click Export to download the file to your PC.

Import the SQL file

  1. Select the database
    In phpMyAdmin, click the database you want to import into in the left sidebar.

  2. Open the Import tab
    Click Import at the top.

  3. Choose the file
    Under File to import, use Browse your computer to select your .sql file. The maximum file size you are allowed to upload is shown right next to that label.

  4. Check the character set
    Leave Character set of the file on utf-8 unless your file explicitly uses a different encoding. Otherwise special characters end up broken in the database.

  5. Check the format
    SQL has to be selected under Format. phpMyAdmin usually detects this automatically from the file extension.

  6. Start the import
    Click Import at the bottom and wait until the page has finished loading. Do not close the browser tab in the meantime.

Check the result

  1. Read the message
    After a successful import, the message "Import has been successfully finished, X queries executed." appears at the top.

  2. Verify the tables
    Click your database on the left and then on Structure. The tables from the .sql file should now be listed there.

  3. Start the server
    Start your server via the dashboard and check the console for database errors.

Importing large SQL files

The upload limit on the import page is a setting of the web server phpMyAdmin runs on. You cannot change it yourself. If your file is too large or the import stops after a while, you have these options:

  1. Compress the file
    phpMyAdmin reads compressed files directly, and only the compressed size counts towards the upload limit. The file name has to end in .[format].[compression], for example database.sql.zip. Which compression formats are supported is shown in the note at the top of the import page.

  2. Allow a partial import
    Under Partial import, tick Allow the interruption of an import in case the script detects it is close to the PHP timeout limit. phpMyAdmin then stops the import in a controlled way before the PHP time limit hits and continues from the stored position when you submit again.

  3. Split the file
    Split the .sql file into several smaller files and import them one after another in their original order. Make sure you do not cut a statement in half.

Common errors

Symptom Cause and solution
Permission error (Access denied) The file contains CREATE DATABASE or USE. Remove those lines and import into your existing database.
Error while creating a foreign key Remove the tick from Enable foreign key checks under Other options and repeat the import.
The file cannot be selected or is too large The upload limit is exceeded. See Importing large SQL files.
The import stops without a success message Usually a timeout. See Importing large SQL files.
Table already exists The table was imported before. Back it up and delete it before repeating the import.
Written byEmeraldHost Team
Last updated on Aug 7, 2026 Edit on GitHub

Did this article help you?

Your feedback helps us improve our guides.

Help shape the guides

€10.00 in credit for every new guide, €5.00 for every improvement.

Contact Support

Create a support ticket and our team will get back to you as soon as possible – personal and professional.

Go to Support
1257 members online

Discord Community

Connect with other players, get quick help from the community, and stay up to date with the latest news.

Join Discord
FiveM

Ready to get started?

Rent your FiveM Server now

Join our Discord community 1257 members online right now