Skip to content

What is MySQL

Xyranaut edited this page Jun 1, 2026 · 1 revision

What is MySQL? (start from zero)

This page assumes you know nothing about databases. We'll go slow.

A database is just a very organized notebook

Imagine your game server needs to remember things about players: their money, their score, their admin level. Where do you put that so it's still there tomorrow?

You could write it in a text file. But text files get messy fast — what if two players save at the same time? What if you have 10,000 players? How do you quickly find "the player named Bob"?

A database solves this. Think of it as a magic notebook that:

  • keeps your data in neat tables (like a spreadsheet),
  • can find any row instantly (even among millions),
  • handles many writers at once without scrambling the data,
  • survives a server restart.

MySQL is one of the most popular database programs in the world. It's the "notebook" your server writes to and reads from.

Tables, rows, and columns

A table is a grid. Here's an accounts table:

+----+----------+-------+-------+
| id | name     | money | level |   <- columns (what we store)
+----+----------+-------+-------+
| 1  | Alice    | 5000  | 0     |   <- a row (one player)
| 2  | Bob      | 250   | 4     |   <- another row
+----+----------+-------+-------+
  • Columns describe what you store (name, money, level).
  • Rows are the actual entries (one row per player).
  • id is a unique number for each row, so there's never confusion between two players, even if they pick the same name.

You talk to it with SQL

You don't click buttons to use a database — you send it short text commands in a language called SQL (Structured Query Language). Examples:

-- give me Bob's money
SELECT money FROM accounts WHERE name = 'Bob';

-- create a new player
INSERT INTO accounts (name, money, level) VALUES ('Carol', 0, 0);

-- Bob earned 100
UPDATE accounts SET money = money + 100 WHERE name = 'Bob';

That's basically it: SELECT (read), INSERT (add), UPDATE (change), DELETE (remove). Everything else builds on those four.

Where does omp-MySQL fit?

Your open.mp server is written in Pawn. Pawn can't speak SQL to MySQL on its own — it needs a translator. omp-MySQL is that translator: you call simple Pawn functions like mysql_execute(...), and it sends the real SQL to MySQL over a secure connection, then hands you back the answer.

Next: How an open.mp server talks to a database →

Clone this wiki locally