How to Install Latest MySQL 8.4 LTS on Ubuntu
The issue with outdated MySQL packages in the default repository for both currently supported Ubuntu LTS releases (22.04 and 24.04) is the same as that previously described for PHP and Apache. When installing the mysql-server package from the default repository, the latest available version is 8.0.44 from the 8.0 series.
There are no signs of MySQL 8.4 availability in the default repository, and MySQL 8.0 will reach End-Of-Life in April 2026, which makes it unsuitable for new projects and installations unless there are legacy dependencies requiring it.
To fill this gap and install MySQL 8.4 LTS, the MySQL APT Repository needs to be added. The repository can be configured by downloading and installing the deb package for automatic configuration.
$ wget https://dev.mysql.com/get/mysql-apt-config_0.8.36-1_all.deb
$ sudo dpkg -i mysql-apt-config_0.8.36-1_all.deb
This will show the “Package configuration” dialog:
┌────────────────────────────────────┤ Configuring mysql-apt-config ├─────────────────────────────────────┐
│ The MySQL APT Repository features MySQL Server along with a variety of components. You may select the │
│ desired products to install and update from the official MySQL Repository, and also select the |
| associated version series. │
│ │
│ Select "Ok" to save the configuration, and then execute "apt update" to load the selected package list. │
│ This configuration can be updated later, depending on your needs. │
│ │
│ Which MySQL product do you wish to configure? │
│ │
│ MySQL Server & Cluster (Currently selected: mysql-8.4-lts) │
│ MySQL Connectors (Currently selected: Enabled) │
│ Ok │
│ │
│ │
│ <Ok> │
│ │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Keeping the default settings, the down arrow needs to be pressed twice to navigate to the “Ok” item, then Enter needs to be pressed to confirm and set up the APT repository.
After that, the package list needs to be updated:
$ sudo apt update
References to the MySQL APT Repository (URL: http://repo.mysql.com/apt/ubuntu) should be present in the output at this stage:
...
Get:4 http://repo.mysql.com/apt/ubuntu noble InRelease [22.7 kB]
...
Get:6 http://repo.mysql.com/apt/ubuntu noble/mysql-8.4-lts Sources [980 B]
Get:7 http://repo.mysql.com/apt/ubuntu noble/mysql-apt-config amd64 Packages [568 B]
Get:8 http://repo.mysql.com/apt/ubuntu noble/mysql-8.4-lts amd64 Packages [12.6 kB]
Get:9 http://repo.mysql.com/apt/ubuntu noble/mysql-tools amd64 Packages [4193 B]
...
All packages are up to date.
After that, MySQL 8.4 LTS Server can be installed. While the mysql-server package will now be overridden by the MySQL repository, it is better to install it through the mysql-community-server package to distinguish it from the original Ubuntu package.
$ sudo apt install mysql-community-server
During installation, a dialog window will be shown to enter the MySQL root password:
┌────────────────────────────────────────┤ Configuring mysql-community-server ├───────────────────────────┐
│ Please provide a strong password that will be set for the root account of your MySQL database. Leave it │
│ blank to enable password less login using UNIX socket based authentication. │
│ │
│ Enter root password: │
│ │
│ _______________________________________________________________________________________________________ │
│ │
│ <Ok> │
│ │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────┘
A similar dialog will appear to re-enter the root password.
┌────────────────────────────────────────┤ Configuring mysql-community-server ├───────────────────────────┐
│ Now that you have selected a password for the root account, please confirm by typing it again. Do not |
| share the password with anyone. │
│ │
│ Re-enter root password: │
│ │
│ _______________________________________________________________________________________________________ │
│ │
│ <Ok> │
│ │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────┘
After installation, MySQL can be connected to using the MySQL CLI client, which is installed from the dependent mysql-community-client package. The root password defined during installation needs to be used to connect via TCP/IP:
$ mysql -h localhost -u root -p
Enter password:
The following output from MySQL, showing version 8.4.7, confirms that it is properly installed and accessible.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.4.7 MySQL Community Server - GPL
Copyright (c) 2000, 2025, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Typing ’exit’ and pressing Enter will properly disconnect from MySQL and close the client, showing a ‘Bye’ message.
mysql> exit
Bye
In this post, the process of avoiding MySQL 8.0 installation from the default repository was reviewed. Instead, MySQL 8.4 LTS was installed from the MySQL APT Repository, and the installation was verified through connection and version checking.