RedMGuideYou do not need HeidiSQL, phpMyAdmin, or a database login. Put your .sql files in server-data/sql on the Files card and restart your server. Each file is…
You do not need HeidiSQL, phpMyAdmin, or a database login. Put your .sql files in server-data/sql on the Files card and restart your server. Each file is imported into your server's own database while the server starts, once, in alphabetical order. A file with a mistake in it is skipped, and your server still starts.
Every RedM server on Haptic has its own private database. Frameworks and scripts use it through oxmysql, which is installed on every server. That database is not reachable from the internet, on purpose: it holds your players' characters, money, and inventories. Instead of handing out database logins, your server watches one folder, server-data/sql, and imports whatever SQL files you put there.
Open your server on Haptic and go to the Files card. Open server-data, then sql. There is a README inside explaining these same steps. If the folder is missing, create it with New folder and name it exactly sql.
Upload the files straight into that folder. They must sit directly in server-data/sql, not inside a subfolder. If order matters, name them 01-tables.sql, 02-data.sql and so on: files run in alphabetical order.
Each file is imported into your server's database while the server starts, before RedM itself starts. The Console does not list these imports. To check that a file went in, look for its tables with a database program over the secure tunnel (see Connect to your server's database), or start the script that needs them.

Replacing your whole database with an export from another host? Use Upload World instead: it installs the export in your server's database on the next start, and your previous database is in the backup taken before the upload. The sql folder is for scripts that add to your database.
Each file runs once. After a file imports, it is remembered and skipped on later restarts. A new file, or a file you changed, runs on the next restart. A changed file runs again in full, so plain INSERT statements will insert again.
A broken file cannot take your server down. It is skipped, everything else still imports, and your server tries it again at every start until it goes in. The Console does not show the database error, so if a file will not import, message us with its name and we will look the error up for you. Fix the file, upload it again, and restart.
You do not need CREATE DATABASE or USE lines. Everything goes into your server's own database automatically. If your dump has those lines, they are ignored on purpose.
One big dump is fine. Exporting from a local tool? Save it as one file, name it 00-import.sql, and drop it in. If a very large dump will not go through, message us and we will import it for you.
Scripts talk to the database live. Tables your resources create at runtime through oxmysql work as usual. The sql folder is for files you would otherwise import by hand.
Leaving a .sql file inside a resource folder, like server-data/resources/my-script/schema.sql. Scripts do not run those by themselves. Copy the file into server-data/sql instead.
Putting files in a subfolder like server-data/sql/my-pack/. Only files directly in the sql folder are imported.
Connecting a database program straight to a public address. Port 3306 is never exposed to the internet on purpose. If you want to browse or edit the database live with HeidiSQL, Navicat, or DBeaver, use the secure SSH tunnel instead: see Connect to your server's database.
Message us on Discord with your server name and, if an import failed, the name of the file. We are happy to import a dump for you or take a look at a stubborn file.