ID #1010

What is HTTP-tunneling?


HTTP-tunneling is a method for connecting to a MySQL server that uses the same protocol (http://) and the same port (port 80) as a webserver does. This can be very useful when connecting to a MySQL server at an ISP. Because it is always available where a webserver with the LAMP- or WAMP-stack is available.

"Direct connection" to MySQL normally uses port 3306, but that port is often closed for security reasons. By using the same port as the webserver does, your connection cannot be blocked! But to enable this a "translation engine" must be available at the webhost, that translates the in- and outgoing traffic on port 80 to internal traffic using the MySQL port(3306). This "translation engine" is the tunneling script provided with SQLyog. This script (a PHP script) must be uploaded to some place on the webserver that you have access to and from where PHP can connect to MySQL. That would normally be (but need not be) the root directory of your website. If you can access your website and if the webserver has PHP installed and PHP is configured to connect to MySQL then you can access the tunneling file too.

Note that our tunneling script is only functional for connecting to MySQL when accessed from SQLyog and the SQLyog Job Agent (SJA). If you access it from a browser it will just display the version of the script and a short message where it identifies itself.

Thus we have established this communications chain

SQLyog <-port80-> Tunneling Script <-port3306-> MySQL server

and SQLyog <--> MySQL Server communication has been established.

Here you will find a detailed example of using and setting up SQLyog HTTP tunneling with the "Yahoo Small Business MySQL Server" service. Same steps apply for most 'shared hosting'.

Also read about SSH-tunneling.


Tags: -

Related entries:

You can comment this FAQ

Comment of francois:

I am testing 7.02, and the connection windows are rather different from those in this article, and so it is of no use.

Please, redo this article for 7.02


Added at: 2008-09-24 10:43

Comment of peter laursen:
@Francois .. are you referring to the PDF-article about "Yahoo Small Business MySQL Server"
Added at: 2008-09-24 11:31

Comment of Peter Laursen:
The article linked to has been updated and so has the link!
Added at: 2009-03-12 11:36

Comment of Davud:
Also you can use super network tunnel do it, a professional http tunnel server program. Can find it at
Added at: 2009-11-17 02:19