Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL workbench says bad handshake

I tried connecting the database from the server, but MySQL Workbench says that the connection cannot be made and declaring it as Bad Handshake. Can someone help me with this? But if I use the same user id and password and DB connections, it works on the other computer systems. Can someone solve this issue?

like image 362
user1722657 Avatar asked Mar 14 '19 10:03

user1722657


2 Answers

The authentication has changed from mysql V8, you must use a compatible client and server.
BTW it's a bug : https://bugs.mysql.com/bug.php?id=91828

Here is a workaround without uninstalling the new workbench.
The most probable case is having an old server with a new workbench:

  1. get the server version

From a SQL cli tool:

SHOW VARIABLES LIKE "%version%";

or from a cli connected on the server:

$ mysql -v

It should show a version < 8.0, in my case 5.1.73

  1. Get the mysqlWorkbench for a version <8.0:
    You cannot install the msi if you already have a workbench V8.0, so you have to choose a portable installation form a zip file here:

https://dev.mysql.com/downloads/workbench/6.1.html

Select the version 6.2.5 (last before v8.0) zip version

Unzip
Close the workbench v.8 (it lock any other workbench launch)
Launch the V6.2.3 version of workbench, it should works.

like image 68
pdem Avatar answered Sep 20 '22 20:09

pdem


This is probably because of a mismatch in the versions of MySQL servers. Check the version of the MySQL server you are trying to connect to, and the version you have installed on the computer you are using, they have to be the same.

like image 20
Abd Alrahman Avatar answered Sep 17 '22 20:09

Abd Alrahman