Ravi Sir's Cyber Security Cards › Revision Cards
Installing MySQL or MariaDB
Installing MySQL or MariaDB MySQL and MariaDB are databases that store website data. Amazon Linux 2023 uses MariaDB. Ubuntu uses MySQL 8. The database should listen only on 127.0.0.1 (local only). Port 3306 must never be open to the internet. Scanners find open databases and steal or ransom the data

Read card text
What this card says
What it is
MySQL and MariaDB are databases that store website data.
Amazon Linux 2023 uses MariaDB. Ubuntu uses MySQL 8.
Why it matters for security
The database should listen only on 127.0.0.1 (local only).
Port 3306 must never be open to the internet. Scanners find open databases and steal or ransom the data.
Check
sudo ss -tlnp | grep 3306 should show 127.0.0.1, not 0.0.0.0.
| OS | Package | Service |
|---|---|---|
| Amazon Linux 2023 | mariadb105-server | mariadb |
| Ubuntu 22.04/24.04 | mysql-server (MySQL 8.x) or mariadb-server | mysql (or mariadb) |
| CentOS Stream 9 | mariadb-server (or mysql-server for MySQL 8) | mariadb (or mysqld) |
| Amazon Linux 2 (older) | mariadb-server | mariadb |
Learn more in the lesson: 10.1 Installing MySQL or MariaDB