Use SQLyog Tunneling for Secure MySQL Server Management

Use SQLyog Tunneling for Secure MySQL Server Management

ost Web hosting providers block port 3306 (the MySQL server port) at the firewall to prevent outside access. As a result, many MySQL developers and administrators can’t access and manage their own MySQL servers remotely; they must use the Web-based interfaces that their ISPs provide. Although these Web-based tools generally are well designed, their responsiveness (or lack thereof) is vexing?especially the annoying page-refreshes.

This security issue takes even more prominence with the recent occurrence of a MySQL worm that attacks Windows Server. The UDF Worm is self-propagating code that finds MySQL servers running on Microsoft Windows with poor firewall and password security and exploits them.

To defend against this worm, MySQL experts recommend the following:

  • Block port 3306 on firewalls (as most ISPs do).
  • Restrict access to root accounts.
  • Use strong passwords that are resistant to brute force attacks.

To navigate such restrictive access, this article demonstrates how to securely connect and manage your MySQL server using SQLyog‘s HTTP and SSH tunneling features.

Using SQLyog with HTTP Tunneling
With HTTP tunneling, you can use all the features of a client/server application by just uploading a single PHP page (SQLyogTunnel.php) to your Web server. SQLyogTunnel.php exposes the MySQL API as a set of Web services that can be consumed by SQLyog (see Figure 1). This is exactly the architecture that Microsoft recommends in its “smart client” initiative.

 
Figure 1. SQLyog and HTTP Tunneling Architecture

SQLyog with HTTP tunneling provides some cool functions that a Web-based admin app can’t, including:

  • Ability to upload any ODBC database (Access, MS SQL, Oracle) directly to your MySQL without going through the cumbersome process of CSV/SQL export/import
  • Context-sensitive menus
  • Synchronizes the schema between your development server and the production server
  • Synchronizes the data between your development server and the production server
  • Saves your work when you click on the close button of your browser!
  • 100 percent keyboard friendly for turbo speed MySQL management

Implement HTTP Tunneling
First, download SQLyog. After installation, provide SQLyog with your MySQL connection details.

To connect to your MySQL DB using HTTP tunneling, upload SQLyogTunnel.php (available with the SQLyog Enterprise installer) in your Web server. SQLyogTunnel.php exposes the MySQL C API as a set of Web services that SQLyog Enterprise can understand. (Note: For SQLyogTunnel.php to work, you need to have PHP compiled with MySQL and XML extensions.)

In the connection window, select the Tunnel tab, check the Use HTTP Tunneling option, and provide the URL of the tunneling page (see Figure 2). Make sure that the MySQL Host Address you provide in the Server tab is accessible from the Tunneling URL. For example, if your Web server and MySQL are hosted on 234.56.45.21, then you need to specify localhost in the MySQL Host Address field of the Server tab instead of 234.56.45.21.

 
Figure 2. HTTP Tunnel Settings in SQLyog Connection Dialog

That’s it. Press Connect to log into your server and enjoy working with SQLyog.

Using SQLyog with SSH Tunneling
HTTP tunneling has slow response times compared with direct connections since the data is XML encoded and HTTP is stateless by nature. If you are lucky, your Web host provides SSH tunneling to your MySQL or Web server. You can then use SQLyog and SSH tunneling to securely and efficiently manage your MySQL database.

What Are SSH and SSH Tunneling?
SSH stands for secure shell host. You can access most systems in two ways. The most common way is to use a telnet program. Accessing a shell account in this fashion poses a danger, however. Everything that you do during a telnet session is visible in plain text on your local network and the local network of the machine to which you are connected.

The alternative way, SSH, provides a solution by encrypting the data being sent over the network, which prevents human-readable passwords from ever being passed over the network. SSH can use several different forms of encryption, anywhere from 56- to 1024-bit, and it has been ported to operating systems on several platforms including Linux, Microsoft Windows, and Macintosh.

You can use SSH to encrypt communications between SQLyog and your remote MySQL server. This is known as SSH tunneling and it is actually quite simple to use.

Benefit of SSH Tunneling
Many hosting companies that provide MySQL hosting block access to the MySQL server from outside the hosting company’s network and grant access only to users connecting from localhost or from a machine within the network. The major benefit of SSH tunneling is that it allows you to connect to a MySQL server from behind a firewall when the MySQL server port is blocked (see Figure 3). As long as the hosting company provides SSH access, you can still connect through SQLyog’s SSH Tunneling option.

 
Figure 3. SSH Tunneling Architecture

Setting Up SQLyog for SSH Tunneling
Select the Tunnel tab in the connection window (see Figure 4) and provide the information listed in Table 1.

Username: Username to access the SSH server
Password: Password to access the SSH server
SSH Host: Address of the machine on which SSH server is running
SSH Port: Port on which SSH server is listening (22 by default)
Localhost: Value always is localhost and read-only, because SQLyog creates the SSH port forwarding option on the local machine only
Local Port: Port on which SQLyog will listen locally for correctly port forwarding MySQL requests. (Note: If you are connecting to two (or more) MySQL servers, then you need to provide two different local port values in the respective connections.)
Table 1. SSH Connection Settings Information
 
Figure 4. SQLyog SSH Tunneling Settings

To understand the setup better, connect to a MySQL server using the following real life example:

  • Your Web site is hosted on the Web server 234.56.65.78, which also hosts a SSH server that runs and listens on port 22.
  • Your MySQL server is located on server 234.56.65.79, and it allows connections only from localhost or another machine within the same network (i.e., 234.56.65.78).
  • You publish your Web site on 234.56.65.78 using the username and password your ISP provides (for this example, the username and password are ssh_user and ssh_pwd, respectively).

To complete the setup for this example, you have to input the following values for various server and tunnel options:

Server Tab
MySQL Host Address 234.56.65.79
Username Your mysql user name
Password Your mysql password
Database The database that you want to connect to (You can leave this field blank.)
Port The port MySQL is listening (3306 by default)
Tunnel Tab
Username ssh_user
Password ssh_pwd
SSH Host 234.56.65.78
SSH Port 22
Local Host Always localhost
Local Port Any port that is unused on your local machine (If you don’t have a MySQL running on your machine, you can provide 3306.)

Press Connect to log into your server, and you can then use SQLyog and SSH tunneling to securely and efficiently manage your MySQL database.

Secure Connectivity with SQLyog
SQLyog gives you a choice of connectivity options. No matter what your firewall/proxy/ISP settings are, you should be able to use it to smartly manage your MySQL server(s).

devx-admin

devx-admin

Share the Post:
Savings Extravaganza

Big Deal Days Extravaganza

The highly awaited Big Deal Days event for October 2023 is nearly here, scheduled for the 10th and 11th. Similar to the previous year, this

Remote Learning

Revolutionizing Remote Learning for Success

School districts are preparing to reveal a substantial technological upgrade designed to significantly improve remote learning experiences for both educators and students amid the ongoing

Revolutionary SABERS Transforming

SABERS Batteries Transforming Industries

Scientists John Connell and Yi Lin from NASA’s Solid-state Architecture Batteries for Enhanced Rechargeability and Safety (SABERS) project are working on experimental solid-state battery packs

Savings Extravaganza

Big Deal Days Extravaganza

The highly awaited Big Deal Days event for October 2023 is nearly here, scheduled for the 10th and 11th. Similar to the previous year, this autumn sale has already created

Cisco Splunk Deal

Cisco Splunk Deal Sparks Tech Acquisition Frenzy

Cisco’s recent massive purchase of Splunk, an AI-powered cybersecurity firm, for $28 billion signals a potential boost in tech deals after a year of subdued mergers and acquisitions in the

Iran Drone Expansion

Iran’s Jet-Propelled Drone Reshapes Power Balance

Iran has recently unveiled a jet-propelled variant of its Shahed series drone, marking a significant advancement in the nation’s drone technology. The new drone is poised to reshape the regional

Solar Geoengineering

Did the Overshoot Commission Shoot Down Geoengineering?

The Overshoot Commission has recently released a comprehensive report that discusses the controversial topic of Solar Geoengineering, also known as Solar Radiation Modification (SRM). The Commission’s primary objective is to

Remote Learning

Revolutionizing Remote Learning for Success

School districts are preparing to reveal a substantial technological upgrade designed to significantly improve remote learning experiences for both educators and students amid the ongoing pandemic. This major investment, which

Revolutionary SABERS Transforming

SABERS Batteries Transforming Industries

Scientists John Connell and Yi Lin from NASA’s Solid-state Architecture Batteries for Enhanced Rechargeability and Safety (SABERS) project are working on experimental solid-state battery packs that could dramatically change the

Build a Website

How Much Does It Cost to Build a Website?

Are you wondering how much it costs to build a website? The approximated cost is based on several factors, including which add-ons and platforms you choose. For example, a self-hosted

Battery Investments

Battery Startups Attract Billion-Dollar Investments

In recent times, battery startups have experienced a significant boost in investments, with three businesses obtaining over $1 billion in funding within the last month. French company Verkor amassed $2.1

Copilot Revolution

Microsoft Copilot: A Suit of AI Features

Microsoft’s latest offering, Microsoft Copilot, aims to revolutionize the way we interact with technology. By integrating various AI capabilities, this all-in-one tool provides users with an improved experience that not

AI Girlfriend Craze

AI Girlfriend Craze Threatens Relationships

The surge in virtual AI girlfriends’ popularity is playing a role in the escalating issue of loneliness among young males, and this could have serious repercussions for America’s future. A

AIOps Innovations

Senser is Changing AIOps

Senser, an AIOps platform based in Tel Aviv, has introduced its groundbreaking AI-powered observability solution to support developers and operations teams in promptly pinpointing the root causes of service disruptions

Bebop Charging Stations

Check Out The New Bebob Battery Charging Stations

Bebob has introduced new 4- and 8-channel battery charging stations primarily aimed at rental companies, providing a convenient solution for clients with a large quantity of batteries. These wall-mountable and

Malyasian Networks

Malaysia’s Dual 5G Network Growth

On Wednesday, Malaysia’s Prime Minister Anwar Ibrahim announced the country’s plan to implement a dual 5G network strategy. This move is designed to achieve a more equitable incorporation of both

Advanced Drones Race

Pentagon’s Bold Race for Advanced Drones

The Pentagon has recently unveiled its ambitious strategy to acquire thousands of sophisticated drones within the next two years. This decision comes in response to Russia’s rapid utilization of airborne

Important Updates

You Need to See the New Microsoft Updates

Microsoft has recently announced a series of new features and updates across their applications, including Outlook, Microsoft Teams, and SharePoint. These new developments are centered around improving user experience, streamlining

Price Wars

Inside Hyundai and Kia’s Price Wars

South Korean automakers Hyundai and Kia are cutting the prices on a number of their electric vehicles (EVs) in response to growing price competition within the South Korean market. Many

Solar Frenzy Surprises

Solar Subsidy in Germany Causes Frenzy

In a shocking turn of events, the German national KfW bank was forced to discontinue its home solar power subsidy program for charging electric vehicles (EVs) after just one day,

Electric Spare

Electric Cars Ditch Spare Tires for Efficiency

Ira Newlander from West Los Angeles is thinking about trading in his old Ford Explorer for a contemporary hybrid or electric vehicle. However, he has observed that the majority of

Solar Geoengineering Impacts

Unraveling Solar Geoengineering’s Hidden Impacts

As we continue to face the repercussions of climate change, scientists and experts seek innovative ways to mitigate its impacts. Solar geoengineering (SG), a technique involving the distribution of aerosols

Razer Discount

Unbelievable Razer Blade 17 Discount

On September 24, 2023, it was reported that Razer, a popular brand in the premium gaming laptop industry, is offering an exceptional deal on their Razer Blade 17 model. Typically

Innovation Ignition

New Fintech Innovation Ignites Change

The fintech sector continues to attract substantial interest, as demonstrated by a dedicated fintech stage at a recent event featuring panel discussions and informal conversations with industry professionals. The gathering,

Import Easing

Easing Import Rules for Big Tech

India has chosen to ease its proposed restrictions on imports of laptops, tablets, and other IT hardware, allowing manufacturers like Apple Inc., HP Inc., and Dell Technologies Inc. more time

Semiconductor Stock Plummet

Dramatic Downturn in Semiconductor Stocks Looms

Recent events show that the S&P Semiconductors Select Industry Index seems to be experiencing a downturn, which could result in a decline in semiconductor stocks. Known as a key indicator

Anthropic Investment

Amazon’s Bold Anthropic Investment

On Monday, Amazon announced its plan to invest up to $4 billion in the AI firm Anthropic, acquiring a minority stake in the process. This decision demonstrates Amazon’s commitment to