It happens very often that we do not have direct access to our databases, especially if we are talking about internet hosting.
As a rule due to security reasons hosting provider closes all “non-standard” ports (except HTTP, FTP, SSH and some other). As a result users are forced to use various weird solutions like phpMyAdmin. Poor things…
If you have SSH access to your hosting then you are lucky (just as me).
Just dance 2021 switch unlimited. Here we will talk about how to use SSH tunnels to access our “unaccessible” databases from Windows (I believe most of Unix-guys knows how to use SSH-tunneling).
- You may also need to allow ssh login based management as one of the mysql workbench options under server connections - remote management. It's also a good idea to set the Edit - Preferences - SQL Editor - DBMSConnection keep alive interval setting to 200, to avoid any 'lost connection' issues due to our 5-minute connection timeout.
- DBeaver is a universal database management tool for everyone who needs to work with data in a professional way. With DBeaver you are able to manipulate with your data like in a regular spreadsheet, create analytical reports based on records from different data storages, export information in an appropriate format.
DBeaver Universal Database Tool Free multi-platform database tool for developers, database administrators, analysts and all people who need to work with databases. Supports all popular databases: MySQL, PostgreSQL, SQLite, Oracle, DB2, SQL Server, Sybase, MS Access, Teradata, Firebird, Apache Hive, Phoenix, Presto, etc. Termius is more than a mere SSH client – it’s a complete command-line solution that’s redefining remote access for sysadmins and network engineers. Securely access Linux or IoT devices and quickly fix issues from the comfort of your couch via laptop or phone.
In fact it is very easy.
First of all you should get some SSH client, for example PuTTY or Bitvise Tunnelier. For this article let’s take PuTTY as one of most popular free SSH client for Windows.
We switched to calendar versioning: version 21.0 comes after 7.3. Main changes since 7.3: - Big number of improvements in data transfer tool (insert or update, types mapping, ordering, etc) - Spatial viewer: 3D objects support, custom tiles, SQLite support - SQL editor panels (log, output, result tabs, toolbars) were significantly redesigned - MacOS: a lot of UI rendering bugs were fixed.
Dbeaver Ssh Login
I’ll use real-life configuration which I use to access databases on our hosting. Let’s assume that we want to access MySQL database on db.jkiss.org server.
1. Open PuTTY and specify Host Name of your remote server. By default port number is 22, however your ISP may use another one (again, for security reasons). Anyway, you should know it.
2. Go into Connection -> SSH -> Tunnels section.
Enter value on your choice in Source Port box. For example 7777.
Enter “localhost:3306” in Destination box.
It means that SSH will tunnel port 3306 (default MySQL port) from remote server to port 7777 on local computer.
To simplify configuration you may use the same port number on server and on client (3306) – but it won’t work if you have MySQL server on your local computer (and this is exactly my case).
Dbeaver Ssh Tunnel
3. Click “Add” button.
4. Click Open button.
5. Login to your remote server through SSH as usual
That’s it, now you may use DBeaver to connect to your remote database. Just connect to localhost:7777 (or other port number you entered on step 2).
Dbeaver Ssh List
Note that you should keep SSH connection (Putty window) open while you are working with database.
Read more about SSH.