Forums

multiple ssh connections

Hi there, im kinda new in databases so its possible my question is dumb.

Im connecting to MySQL db via python and SSH - its all working fine. Also im using DBeaver for the same database and there are no issues as well However: Im unable to use both at the same time. What can I do with that? I really need to be able to see the tables in realtime via DBeaver while im running app from VSC.

What are the errors you see while you try using them both?

DBeaver just keeps trying to connect and eventually returns timeout. Running from code gives me "Lost connection to server at 'handshake: reading initial communication packet"

What configuration do you have for each? They'll both be using SSH tunnelling, which means they'll start up a server running on your local machine that listens on a particular local port, and on the other side connects to the PythonAnywhere SSH server and forwards anything that comes in on that local port over the SSH connection and on to the MySQL server. So (conceivably) they could be fighting over which local port to use -- that might cause effects like the ones you're seeing.

Hi, here's screenshot of my configuration: https://imgur.com/a/ssh-settings-0bWggJj

Huh, that should be fine -- there's nothing there forcing them to both use the same port number. Am I right in thinking that when you try to use both at the same time, the first one you start connects OK, and the second one fails?

Which OS are you using?

Yes and also I need to wait few minutes after using one to switch to other. Im using Windows 10.

We do not have anything that prevents multiple SSH connections - I often have multiple SSH connections open to my PythonAnywhere account. Perthaps something on your machine (the OS or a firewall or antivirus) is preventing the second connection. You could try opening one SSH tunnel and connecting both things through the one tunnel: https://help.pythonanywhere.com/pages/AccessingMySQLFromOutsidePythonAnywhere/#manual-ssh-tunnelling