How to Install MySQL 8 on Ubuntu 26.04

To install MySQL 8 on Ubuntu 26.04, use the distro package (MySQL 8.4) and run mysql_secure_installation.

Step 1 : Update.

Step 2 : Install MySQL. Ubuntu’s package is MySQL 8.4.

Step 3 : Secure the install. VALIDATE PASSWORD depends on the machine (Y then 0/1/2, or N).

  • Remove anonymous users: Y
  • Disallow root login remotely: Y
  • Remove test database: Y
  • Reload privilege tables: Y

Step 4 : Start and enable.

Step 5 : Check status.

Step 6 : Log in. Root uses the socket — do not pass -p.

Step 7 : Create an admin user (change the password).

You have installed MySQL 8 on Ubuntu 26.04.