Connecting to database with portforwarding

MySQL port forwarding is a simple way to connect remotely to a Platon Webhosting database with your SQL client.
Port 3306, which MySQL uses, is not open for connections by default, because it is not secured. For that reason we give customers the db.platon.sk interface, secured over HTTPS, to work with the database. If you would rather not use it, set up MySQL port forwarding and connect to the database directly. MySQL port forwarding can be set up on both GNU/Linux and Windows.

Data

You will need the following data to connect:

  • SERVER – the name of your domain
  • SFTP_USER – user for SFTP
  • SFTP_PASS – password for SFTP
  • MYSQL_USER – user for MySQL
  • MYSQL_PASS – password for MySQL

Tunneling will be done through the local port 3333. Before starting, make sure that the port is available. If not, use any other port.

Linux

ssh SFTP_USER@SERVER -L localhost:3333:127.0.0.1:3306
mysql -h 127.0.0.1 --port 3333 -u MYSQL_USER -p MYSQL_PASS

Windows

The use of port forwarding in Windows requires an external program, such as Heidi SQL.
After starting Heidi SQL click on New in the bottom left corner:

  • In Network type select MySQL (SSH tunnel)
  • Hostname / IP leave 127.0.0.1
  • User and password - set the login data for your database.
  • Port - select 3306

Go to the second tab SSH tunnel
In the first box you need to enter the location of the plink.exe file on your computer. This file is part of the Putty tool, so it may already be installed on your computer.
If you are not sure, you can download the file through the link below this item. If you do download it, we recommend saving it in the default directory on your computer, for example C:\Documents and Settings\User.

In this step, you need to save the RSA key to cache memory.
This is done as follows:

  1. In Windows, click Start -> Run. Type in cmd and click OK in the command line that will appear. (In Windows Vista, Windows 7 or higher, type in cmd directly in the search bar in the Start menu).
  2. The Windows command line appears. You should be able to see the path to the default directory, which should be C:\Documents and Settings\User. You need to be in the folder where the plink.exe file is located, which is why it is convenient to save plink.exe in this directory. If the file is saved elsewhere, use the command “CD name of folder” to move between directories and “CD ..” to move up.
  3. Once you are in the correct folder, enter the following command:
    plink.exe SFTPlogin@yourdomain.ext
    In the SFTP login field enter your username to the domain SFTP and the name of your domain after the at sign.
  4. The computer should show the statement seen in the screenshot.
    Enter Y after the question Store key in cache? and press Enter.
    This procedure needs to be applied only the first time; the RSA key will stay stored in cache.

You may now close the command line and return to HeidiSQL settings:

  • In the item SSH host + port enter the name of your domain including www
  • In username and password enter your login to SFTP.
  • In the last item Local port enter 3333.

We recommend saving the settings with Save, so that you do not have to fill the data in again next time.
Click Open to connect to the database.

helpdesk

we are ready to help

currently online

agents online 2 / 6

Platon Technologies

How can we help you?

We accept problem reports and any other feedback related to the use of our products and services.

 

helpdesk@platon.net +421 222 111 321

In case you need any help, contact us by e-mail or by phone.

  • By phone from 8:30 - 17:30
  • Sometimes even on weekends
  • Simple human approach
  • Even complex problems solved
contact form

Give our online help center a try. You will find more than:

  • 6 categories
  • 60 manuals
  • 23 e-mail settings
  • 8 programming tips
go to help center

Questions about our products or any specific request? Contact us.

We are checking whether the message is spam. Please wait...

Thanks for your message

If necessary, we will contact you.

Sending the message failed

Please contact us at helpdesk@platon.net.

NEWSLETTER

Thanks for subscribing

Subscription has failed