How do I deal with MySql incompatibility (8 -> 5)

Recently, we updated one system to UBUNTU 20.04 (it has been way backlevel). The new installation includes MySQL at version 8.

One of the functions we've been performing on the retiring system, is to backup a MySQL remote database, owned by a hosting provider, that's running MySQL 5.x. To my surprise, it seems that MySQL 8 client will not connect with MySQL 5 databases due to this bug:

> mysqldump --host=${REMOTE_HOST} --user=${REMOTE_USER} ${REMOTE_DATABASE}
mysqldump: Got error: 1043: Bad handshake when trying to connect

I'm curious how others in this situation deal with this problem.

Upgrading the remote database is not something we can do (The remote one is managed by another agency that doesn't offer MySql 8), nor is downgrading the local one (the advantages of MySQL8 are among our reasons for upgrading.)

What I'd really like to do, is to install just the mysql 5 client into an alternate folder, and use only mysqldump (also mysql) from that folder for this connection and task only. But there seems to be no official UBUNTU way to do this.

I've had a look at (even installed) dbdeployer, but that looks like yet another time-consuming research project with its own learning curve to get it just so... maybe overkill for the minor thing we want to accomplish.

Any suggestions how do deal with this? Clearly it's less a priority for the MySQL developers than for us.


Try the last LTS Ubuntu release, currently Bionic appears to have MySQL 5.7. Or an Ubuntu container. Or MySQL's 5.7 container, which also appears to be Debian based.

If you wish to stay with popular packages of things, often it is easier to have another OS install with the old version installed. Two versions side by side is not always easy.

You always can upgrade or migrate. Define a plan for upgrading this MySQL database (although you didn't say which 5.x major version). MySQL 5.6 is on Oracle Extended Support and doesn't have that many more years to live. Older versions are already dead.