MySQL first appeared in Sweden in 1995, passed to Sun Microsystems and then to Oracle in 2010, and still has an open-source community edition. It runs as a separate server process, and your application connects to it with a username and password.
How data is organised
- Database: a container for one project’s tables.
- Table: like a spreadsheet sheet with typed columns.
- Row: a single record, such as one order or one user.
- Primary key: a column that uniquely identifies each row, usually
id. - Index: speeds up lookups on a column such as email.
The default storage engine is InnoDB, which supports transactions and foreign keys.
Example: a table and some queries
CREATE TABLE orders (
id INT AUTO_INCREMENT PRIMARY KEY,
customer VARCHAR(100) NOT NULL,
total DECIMAL(10,2) NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
) DEFAULT CHARSET=utf8mb4;
INSERT INTO orders (customer, total) VALUES ('Sara', 250.00);
SELECT customer, total FROM orders
WHERE created_at >= '2026-11-01'
ORDER BY total DESC LIMIT 10;
Common errors
| Error | What it means |
|---|---|
1045 Access denied |
Wrong username or password, or the user isn’t assigned to the database |
2002 Can't connect |
Wrong host or port, or the service isn’t running |
1203 max_user_connections |
The app opened more connections than the user is allowed |
1366 Incorrect string value |
The table’s character set can’t hold the text; use utf8mb4 |
In WordPress, connection problems usually show up as Error establishing a database connection. Error 1045 has its own detailed page.
On ArabyHost
Hosting plans include MySQL/MariaDB databases created from cPanel’s MySQL Databases tool. Database and user names carry your account name as a prefix, such as user_shop. After creating the user, add it to the database with privileges, then use localhost in your connection settings. Manage tables in phpMyAdmin; the steps are in the create a database guide. Note that cPanel calls the tool “MySQL” even when the engine underneath is MariaDB.
FAQ
What's the difference between MySQL and SQL?
SQL is the standard query language; MySQL is software that stores data and understands that language. Other systems such as MariaDB and PostgreSQL speak SQL too, with small differences.
Which character set should I use for Arabic text?
Use utf8mb4 with a collation such as utf8mb4_unicode_ci. MySQL's older utf8 stops at 3 bytes per character, so it can't store emoji and some other symbols.
What host do I put in the connection settings?
When the site and the database are on the same hosting account it's usually localhost, on the default port 3306.