How to Install MySQLDump for MySQL 8.0 on Ubuntu 18.04: Fixing “Package Not Found” Error


2 views

When attempting to install MySQL 8.0 client tools on Ubuntu 18.04, you'll encounter the frustrating "Unable to locate package mysql-client-8.0" error. This occurs because Ubuntu 18.04 (Bionic) ships with MySQL 5.7 by default in its repositories.

While MySQL 5.7 clients can technically connect to MySQL 8.0 servers, you'll miss critical functionality and may encounter compatibility issues:

  • Missing 8.0-specific features in mysqldump (like roles support)
  • Potential authentication protocol mismatches
  • Inconsistent behavior with new data types

The cleanest approach is adding MySQL's official repository:

# Add MySQL APT repository
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29
sudo add-apt-repository 'deb [arch=amd64] http://repo.mysql.com/apt/ubuntu bionic mysql-8.0'

Then install the client package:

sudo apt update
sudo apt install mysql-client-core-8.0

If you can't use the official repo, manually download the package:

wget https://dev.mysql.com/get/mysql-apt-config_0.8.22-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.22-1_all.deb
sudo apt update
sudo apt install mysql-client=8.0.*

Confirm you have the correct version:

mysqldump --version
# Should return: mysqldump Ver 8.0.* for Linux on x86_64
  • Conflicts with existing 5.7 packages (use sudo apt remove mysql-client first)
  • Missing dependencies (libmysqlclient21 may need installation)
  • Corporate firewalls blocking repository access

For Azure VMs specifically:

# Ensure proper connectivity
sudo ufw allow out 80/tcp # HTTP for repo access
sudo ufw allow out 443/tcp # HTTPS

Remember that Ubuntu 18.04 reaches EOL in April 2023 - consider upgrading to 20.04 or 22.04 for long-term support.


When working with MySQL 8.0 on Ubuntu 18.04 (Bionic Beaver), you'll quickly discover that the official repositories don't include the mysql-client-8.0 package. This occurs because Ubuntu 18.04 shipped with MySQL 5.7 as the default version in its repositories.

While the MySQL 5.7 client (mysql-client-5.7) might connect to a MySQL 8.0 server, you'll encounter several issues:

  • Authentication plugin incompatibilities (caching_sha2_password vs mysql_native_password)
  • Missing support for new 8.0 features in the client tools
  • Potential syntax differences in mysqldump output

The most reliable approach is to add MySQL's official repository:

wget https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb
sudo apt-get update
sudo apt-get install mysql-client=8.0.* mysql-community-client-core=8.0.*

If you prefer not to add the entire MySQL repository, you can download specific packages:

wget https://repo.mysql.com/ubuntu/pool/mysql-8.0/m/mysql-community/mysql-client-8.0_8.0.33-1ubuntu18.04_amd64.deb
sudo dpkg -i mysql-client-8.0_8.0.33-1ubuntu18.04_amd64.deb
sudo apt-get install -f

After installation, verify you have the correct version:

mysqldump --version
# Should output: mysqldump Ver 8.0.xx for Linux on x86_64 (MySQL Community Server)

For proper authentication with MySQL 8.0 servers, modify your client configuration:

[client]
default-auth-plugin=mysql_native_password

For containerized environments, consider using the official MySQL client image:

docker run -it --rm mysql:8.0 mysqldump --version

If you encounter "Package not found" errors after adding the repository:

sudo rm /etc/apt/sources.list.d/mysql*
sudo apt-get update
# Then retry the repository installation

Always verify package signatures from external repositories:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29