Forums

Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.

Problem:

Failed to connect to MySQL using DBeaver

Error message:

Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.

Take a look at https://help.pythonanywhere.com/pages/AccessingMySQLFromOutsidePythonAnywhere

enter image description here enter image description here

Sorry, but the images links were expired in my initial message. So I uploaded them again.

Take a look at https://help.pythonanywhere.com/pages/AccessingMySQLFromOutsidePythonAnywhere

I was following the FAQ. And I have been using connection successfully (but I was using MySQL Workbench on Windows OS).

Now I need to connect with DBeaver (or any other software, but not MySQL Workbench, because it has a known bug on Arch Linux for SSH connecting).

What errors are you getting? Is Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost. all you have? Are you able to ssh Aleksey@ssh.eu.pythonanywhere.com ?

Yes, the error message is all I have. enter image description here

Are you able to ssh Aleksey@ssh.eu.pythonanywhere.com from your local terminal?

Yes, it seems to work enter image description here

Maybe it is a bug in the DBeaver or it needs some specific settings.

I think it may be because the MySQL server we are running is v5.6- you will have to make sure DBeaver or any other software supports that.

Solved.

Yes, the problem was that I was using the last MySQL, but I must to use 5.6 version. After downgrading MySQL version in the settings now connection works.

You can add this hint in the FAQ.

Thanks! We'll look into putting that in the help pages. In retrospect, perhaps we should have spotted the warning sign -- in your last-but-one screenshot, the window does say "MySQL 8+".