Yikes! This post is over a year old!
If you think it deserves a rewrite please get in touch or leave a comment.
— Thanks, Ash.
If you attempt to run a mysqldump
on a Ubuntu 20 installation, you may well see the below error:
ERROR 2026 (HY000): SSL connection error: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol
Rather than risking downgrading the level of supported SSL routines for MySQL you could instead remove version 8 of the mysql-client package and re-install version 5.7.
Add the new package repository
First, add a new apt
repository to the server.
curl -OL https://dev.mysql.com/get/mysql-apt-config_0.8.16-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.16-1_all.deb
If you see a prompt that states that MySQL is not supported on this system and for you to select from a list. You can navigate your list using arrow keys. Select bionic
and then on the next screen it will ask you “Which MySQL product do you wish to configure?”.
Go to “MySQL Server & Cluster” and press ENTER. Then select none
from the option list.
Go to “MySQL Tools & Connectors” and press ENTER. Select disabled
.
Go to “MySQL Preview Packages” and press ENTER. Select disabled
Finally, go to Ok
and press ENTER.
Now you need to make a tweak to the file the script just created. Edit the file and replace it’s contents
sudo nano /etc/apt/sources.list.d/mysql.list
New contents:
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out entries below, but any other modifications may be lost.
# Use command 'dpkg-reconfigure mysql-apt-config' as root for modifications.
deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-apt-config
deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-5.7
#deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-tools
#deb http://repo.mysql.com/apt/ubuntu/ focal mysql-tools-preview
deb-src http://repo.mysql.com/apt/ubuntu/ bionic mysql-5.7
Save and Exit (CTRL+X
, then Y
), Then run sudo apt update
to update the package cache.
Remove conflicting packages
Next you’ll need to remove the existing packages.
sudo apt-get remove mysql-client mysql-common mysql-community-client mysql-community-server mysql-server
If you get an error:
E: Unable to locate package mysql-community-client
E: Unable to locate package mysql-community-server
You should re-run the command but remove the mysql-community-client mysql-community-server
from the command.
Now you need to check what versions are available to install.
sudo apt-cache policy mysql-client
mysql-client:
Installed: (none)
Candidate: 8.0.27-0ubuntu0.20.04.1
Version table:
8.0.27-0ubuntu0.20.04.1 500
500 http://mirror.rackspace.com/ubuntu focal-updates/main amd64 Packages
500 http://mirror.rackspace.com/ubuntu focal-security/main amd64 Packages
8.0.19-0ubuntu5 500
500 http://mirror.rackspace.com/ubuntu focal/main amd64 Packages
5.7.36-1ubuntu18.04 500
500 http://repo.mysql.com/apt/ubuntu bionic/mysql-5.7 amd64 Packages
Note the version number that starts with 5.7.X
in your terminal output and copy the full version to your clipboard. (above example: 5.7.36-1ubuntu18.04
)
Install MySQL Client version 5.7
Now re-install mysql-client but specify the version you just copied where i have included $VERSION_NUMBER
below.
sudo apt install -f mysql-client=$VERSION_NUMBER -y
You should now have version 5.7 of MySQL installed. You can confirm this by running:
mysql --version
mysql Ver 14.14 Distrib 5.7.36, for Linux (x86_64) using EditLine wrappe
r
Your mysqldump should now run fine!