> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aps-store.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to import SQL to database?

> Run a script's .sql file on your server database with HeidiSQL, phpMyAdmin or the command line.

Some scripts ship `.sql` files, for example `sql/items_esx.sql` in aps\_cityhall. Run them on the same database your server uses.

> [!NOTE]
>
> Your server's database is the one named in `mysql_connection_string` in your `server.cfg`. Import into that database, not a different one.

> [tab] HeidiSQL
>
> 1. Open HeidiSQL and connect to your database server.
> 2. Click your server's database in the left panel.
> 3. Click **File → Run SQL file...** and select the `.sql` file.
> 4. Confirm, and wait until the query finishes.
> 5. Press **F5** to refresh and check that the new tables or rows are there.

> [tab] phpMyAdmin
>
> 1. Open phpMyAdmin and log in.
> 2. Click your server's database in the left panel.
> 3. Open the **Import** tab.
> 4. Click **Choose File** and select the `.sql` file.
> 5. Click **Import** (or **Go**) at the bottom of the page.

> [tab] Command line
>
> ```bash theme={null}
> mysql -u <user> -p <database> < path/to/file.sql
> ```
>
> Replace `<user>` and `<database>` with the values from your connection string. You are asked for the password.

You can also open a new query window, paste the contents of the `.sql` file and run it. This works in HeidiSQL, phpMyAdmin (**SQL** tab) and the txAdmin database tab.

> [!WARNING]
>
> Make a backup of your database before you import, especially when a file changes or drops existing tables.

Restart the script (or the server) after the import.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.