How to Install MySQL 9.7 LTS on Ubuntu 26.04
Install MySQL 9.7 LTS on Ubuntu 26.04 with Oracle’s APT repository, then verify the server and connect with the MySQL client.
On this page
Ubuntu 26.04 LTS (Resolute Raccoon) is supported by Oracle’s MySQL APT repository, which currently provides MySQL 9.7 LTS for the resolute distribution. This guide configures the repository, selects the LTS series, and verifies the server after installation. See the Ubuntu release list and the MySQL APT repository download page for current platform and package information.
This procedure is for a fresh installation. If the host already has MySQL or MariaDB data, make a verified backup and follow MySQL’s replacement instructions before switching repositories.
Prerequisites
Before you begin, make sure you have:
- Ubuntu 26.04 LTS with internet access.
- A user account with
sudoprivileges. - A fresh MySQL installation, or a verified backup of any existing database you plan to replace.
Add the MySQL APT Repository
Install wget, then download and install the current MySQL APT repository configuration package. As of September 2026, it is version 0.8.40-1:
sudo apt update
sudo apt install -y wget
wget https://dev.mysql.com/get/mysql-apt-config_0.8.40-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.40-1_all.deb
In the configuration dialog, choose MySQL Server & Cluster, then select mysql-9.7-lts. Finish the dialog and refresh the package index:
sudo apt update
Install MySQL Server
Install the server from the selected MySQL 9.7 LTS series:
sudo apt install mysql-server
The installer asks you to set a password for the MySQL root account. If you leave the password blank, local root connections use socket-based authentication.
Verify MySQL and Connect
Check the client version and service status:
mysql --version
sudo systemctl status mysql --no-pager
If you set a password during installation, log in as the MySQL root account with:
sudo mysql -u root -p
If you left the password blank and kept socket-based authentication, connect with sudo mysql.
At the MySQL prompt, verify the server version:
SELECT VERSION();
Exit with exit;.
Manage the MySQL Service
Use systemctl to manage the server:
sudo systemctl start mysql
sudo systemctl stop mysql
sudo systemctl restart mysql
sudo systemctl status mysql --no-pager
The MySQL APT packages start the server after installation and enable it at boot.
Conclusion
You installed MySQL 9.7 LTS on Ubuntu 26.04 using Oracle’s MySQL APT repository. For MySQL 9.7 LTS on Debian 13, see our Debian 13 installation guide; for Fedora 44, see our Fedora 44 installation guide. For Ubuntu 22.04 systems that need the MySQL 8 series, see our MySQL 8.4 LTS guide for Ubuntu 22.04. For more database material, visit our MySQL tutorials and MySQL Reference.