Skip to main content
Resources and database

Written lessons and reference material are currently in English.

On this page

HeidiSQL, hands on

You already wrote SQL in sql-from-zero and queried from Lua in oxmysql-crud. Those lessons talked to the database through code. This one opens the same database with your own eyes. HeidiSQL is the free GUI that lets you connect to MariaDB, create databases, run a resource's schema file, and stare straight at the rows a script saved. By the end you will open a session, create a fivem database, run a .sql, and watch a players table fill up with the exact data your server wrote.

You'll build
A real fivem database in HeidiSQL, then run a script's .sql and SEE the rows that script wrote in the Data tab.
Time
~18 minutes
You need
A standalone MariaDB service running and listening on 127.0.0.1:3306, HeidiSQL installed, and the root password you set during install.
You'll learn
The HeidiSQL panel layout -> opening a local session -> creating a database -> running a .sql two ways -> browsing a table's Data tab to confirm what a script actually saved
BEFORE YOU START

The panel layout

Before you click anything, learn the map. When HeidiSQL launches it does not drop you straight into a database. It opens the Session Manager first, a dialog that holds your saved connections. You pick or create a session, hit Open, and only then does the main window appear.

The main window has three regions. Lock these names in now, because the rest of the lesson points at them constantly.

HeidiSQL · main window
code
┌──────────────────────────────────────────────────────────────┐
│ File  Edit  Search  Tools  Go to  Help        [menu bar]      │
│ [▶ run] [stop] [new query] ...                 [icon toolbar] │
├───────────────────┬──────────────────────────────────────────┤
│ LEFT TREE         │  CENTER · tabbed workspace               │
│                   │  ┌───────┬────────┬───────┬───────────┐  │
│ ▼ 127.0.0.1 (root)│  │ Host  │Database│ Query │   Data    │  │
│   ▼ fivem         │  └───────┴────────┴───────┴───────────┘  │
│     ▦ players     │  ┌──────────────────────────────────────┐│
│     ▦ vehicles    │  │ SQL editor (Query tab)               ││
│     ▦ bans        │  │ SELECT * FROM players;               ││
│   ▶ information_  │  ├──────────────────────────────────────┤│
│       schema      │  │ result grid (rows show here)         ││
│                   │  └──────────────────────────────────────┘│
├───────────────────┴──────────────────────────────────────────┤
│ SQL log + status bar (last query, row count, timing)          │
└──────────────────────────────────────────────────────────────┘
  • LEFT: the database and table tree. The top node is the server you connected to (127.0.0.1). Under it sit your databases, and under each database its tables, views, routines, triggers, and events. This is your map of everything on the server. You right-click nodes here to create things, and you single-click a table here to select it.
  • CENTER: the tabbed workspace. Tabs across the top switch what the center shows. The two you live in are the Query tab (an SQL editor on top, a result grid below) and the Data tab (a grid of a table's actual rows you can read and edit).
  • TOP and BOTTOM: chrome. The menu bar (File, Edit, Search, Tools, Go to, Help) and the icon toolbar with the blue play button sit on top. The SQL log and status bar sit on the bottom and tell you the last query that ran, how many rows it touched, and how long it took.

That is the whole tool. Three regions, two tabs you actually use. Everything below is just clicking around this map on purpose.

Keep reading the full lesson

Sign in to start, then unlock every step of this lesson and the full FiveM School with a membership.

Still ahead in this lesson
  • Build it
  • How it works
  • Common mistakes
  • What you can do now
  • Try it yourself

The remainder of HeidiSQL hands-on is available to FiveM School members.

Open the full lesson to mark it complete.