How do I connect to my hosting database from my PC?
With a program on your computer, such as HeidiSQL, DBeaver, MySQL Workbench or TablePlus, you can work directly with your database on our servers. You do this through an SSH tunnel. For that you need a package with SSH: Power Webhost Three, Power Webhost Four, AI Wordpress Three or Power Reseller.
Why an SSH tunnel and not port 3306?
Database port 3306 is closed to the internet on our servers. An open database port is attacked all day long by bots trying to guess passwords, and a regular database connection is often not encrypted. Access by IP address only helps halfway: your IP address changes now and then and is often shared with others. With an SSH tunnel you log in with your SSH key, everything is encrypted and you don't need to add an IP address.
How to connect
- Add your SSH key in DirectAdmin under SSH Keys (see SSH Keys and logging in with SSH).
- In your program, choose the connection via SSH: in HeidiSQL MariaDB or MySQL (SSH tunnel), in DBeaver the SSH tab, in MySQL Workbench Standard TCP/IP over SSH.
- SSH: the server name of your package (for example linux2024.webawere.nl), port 1967, your DA username and your private key.
- Database: host 127.0.0.1, port 3306, and the full names of the database and user, prefixed with your DA username and an underscore, for example
wtsilefl_shop.
On the command line (Mac, Linux, Windows Terminal) you create the tunnel like this:
ssh -p 1967 -N -L 3307:127.0.0.1:3306 gebruikersnaam@linux2024.webawere.nl
Then connect in your program to 127.0.0.1, port 3307.
No SSH in your package? Switch to a package with SSH: in My WebOké, go to My Products, open your package and choose a different package on the Change hosting package card. For a database connection from your computer you don't need to add an IP address under Access Hosts; addresses or % listed there do not grant access from outside.
See also in the DirectAdmin manual: Database users, privileges and passwords.
Detailed explanation with screenshots: Connecting to your database from outside in the DirectAdmin manual.
