The pick when you're on shared hosting - it's already installed and waiting.
MySQL is one of the most widely deployed databases in the world, and on shared hosting it's usually the only one on offer. That's not a compromise: it's a mature, fast relational database, and the SQL you learn on it carries over almost entirely to PostgreSQL and others.
MySQL is the database result whenever you're on shared hosting and your data isn't real-time. Shared hosts include MySQL (or its compatible fork, MariaDB) with one-click setup and phpMyAdmin, while PostgreSQL and MongoDB are rarely available - so hosting decides it before scale or data shape are considered.
You can create a database, a user and your first table in the control panel in a few minutes, without installing or configuring anything. phpMyAdmin gives you a visual view of your tables and a box to run SQL, which is a genuinely good way to learn. And PHP's PDO extension talks to it out of the box.
Many hosts actually run MariaDB, which began as a fork of MySQL. For everything a beginner does, the two are interchangeable - same SQL, same tools, same PHP code.
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
email VARCHAR(255) NOT NULL UNIQUE,
password_hash VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE posts (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL,
title VARCHAR(200) NOT NULL,
body TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id)
);
Create both tables in phpMyAdmin's SQL tab, insert a few rows by hand, then practise the queries a blog needs: the latest ten posts, all posts by one user, and posts joined with their author's email. When those feel natural, add a comments table and write the join yourself.
For a complete working example with PHP, follow the PHP + MySQL guestbook guide.
utf8mb4 for the database and connection character set. MySQL's older utf8 can't store emoji and some other characters.posts.user_id in the example above already gets one from its foreign key.
Most shared hosts take backups, but check how often and how long they're kept. Before any big change, export your database yourself from phpMyAdmin (or with mysqldump if you have SSH access) and keep a copy off the server.
tags = "php,mysql,web". That's a separate table waiting to happen.password_hash() in a VARCHAR(255).Moving to a VPS or a platform service opens up PostgreSQL, which Stack Picker recommends for most projects off shared hosting. Your SQL knowledge transfers almost entirely - see MySQL vs PostgreSQL for the differences you'll notice.