How to Install MySQL on Linux (Ubuntu / Debian)?
Commands for installing, enabling, and securing MySQL Server on Ubuntu and Debian distributions.
# Step 1: Update package list sudo apt update # Step 2: Install MySQL Server package sudo apt install mysql-server -y # Step 3: Enable and start mysqld service sudo systemctl enable --now mysql # Step 4: Run security configuration script sudo mysql_secure_installation
Synchronizing state of mysql.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable mysql ● mysql.service - MySQL Community Server Active: active (running) since Tue 2026-09-01 10:00:00 UTC