'DBeaver connection via SSH tunnel

Using DBeaver, I'm trying to connect to my AWS ec2 instance where I've installed a MariaDB database.

I've created a new connection as:

  • Connection: AWS / Maria DB
  • Server Host: localhost (because I'm using ssh to connect)
  • Database, Username and Password: the right ones
  • Port: 3306

SSH tunnel on the connection:

  • Use SSH Tunnel: checked
  • Host/IP, Port and User: as suggested by the AWS documentation
  • Auth: Public Key
  • Private key: file .pem (the one I'm also using to connect via ssh from command line)

The connection works great at the beginning. After some minutes of inactivity if I open a table the connection stucks and I need to invalidate/reconnect to fetch the data. This process sometimes is done by DBeaver, after 15 seconds of not fetching anything, but sometimes even if I wait 2 minutes it keeps running but fetching nothing.

Is there something I'm missing in my configuration? Or some configuration on the server maybe.. I don't know..

Have you ever had this problem?



Solution 1:[1]

Here I had the same situation. Previous versions of DBeaver used to keep the connection longer (I don't remember precisely which version), in the order of hours.

I solved this issue by using a VPN or a SSH port forwarding from my machine. So, it is the same configuration as yours with localhost, but the tunnel is done outside DBeaver.

Solution 2:[2]

config using pem key in shh tunel

enter image description here

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 sɐunıɔןɐqɐp
Solution 2 user3175453