1

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.

3
  • you can always download old MySQL sources from MySQL archives, then build only MySQL client to a specified directory prefix to avoid it messing with your MySQL install.
    – mforsetti
    Commented Feb 24, 2021 at 4:08
  • This is not a bug. By default, MySQL 8 doesn't configure password authentication anymore, but it can be done without too much fuzz. See for example mysqlserverteam.com/…. Commented Feb 24, 2021 at 5:32
  • @berndbausch it is an accepted (and unresolved) bug at mysql. In my question I provided a link that will take you to the details. That said, I am interested in the solution you provided, but it looks to me like that involves changes to the Server. But this is a Client side issue: MYSQL8 will not connect with MYSQL5. I still hope you have a solution, but I have not been able to locate any through several days of searching. Any links for successful connection from v8 Client to v5 Server?
    – Dennis
    Commented Feb 24, 2021 at 17:33

1 Answer 1

1

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.

6
  • Again, the machine on which the version 5 (5.6, to answer) is running, is managed by a provider not willing to upgrade or migrate the database. So, no, that is not something we can "always" do. And it looks like you're suggesting we downgrade our Version 8 system, which I've already said, is not something we want to do. The other option you mention implies we have extra systems laying around. That's not the case. The "answers" given here don't answer the question, they try to avoid it. The need to access MySQL8 from MySQL5 is real and we cannot avoid it.
    – Dennis
    Commented Feb 24, 2021 at 16:14
  • The answer suggested to use a container, which is a good compromise here I think. You will have the tool needed for backup available via container and then recent MySQL otherwise. Commented Feb 24, 2021 at 18:09
  • The choice here is between protocol analysis and possibly development on end of life software, versus a painful but documented procedure to migrate to hosting with an upgraded version. Maybe they can be configured to be compatible, but I don't know how, maybe Oracle does if you ask their support. Which leaves an upgrade as the best chance of success to get you those features. Commented Feb 24, 2021 at 19:31
  • Ah, @TeroKilkanen I had missed that container bit (thought he meant "package"). I've worked with VMs but containers on Ubuntu were new to me. I see now what he meant. A little research with Ubuntu and Container and MySql5 revealed this post, just what I need! I will accept the answer but I do wish it would be reworded for clarity... and maybe include that link.
    – Dennis
    Commented Feb 24, 2021 at 23:52
  • I hinted at both package and container to encourage creativity and choice in how software is managed. Hopefully it only has to exist long enough to get a dump and allow you to upgrade. Commented Feb 25, 2021 at 3:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .