How to use HeidiSQL to connect to a MySQL database

HeidiSQL is an all-in-one tool for database management, development and administration. You can use HeidiSQL to remotely connect to a database created here at . While ours offer phpMyadmin to help you with database administration, HeidiSQL is the preferred choice for many developers. Using it can speed up development quite a bit. The remote MySQL connection made through your local machine will allow you to apply new updates and changes faster, saving you the trip to the hosting control panel.

Before starting this HeidiSQL tutorial, you will need the following:

  1. HeidiSQL Client
  2. MySQL remote entry for your IP address
  3. MySQL database credentials

We are assuming that you already have a HeidiSQL client installed on your local machine. So we will start by explaining the steps to access a MySQL database created on .

Step 1 – Allow a remote MySQL connection from your IP address

First of all, identify your IP address using any online tool. One way to do this is to write What is my ip in . Here is an example:

Then go to the section MySQL Remote in your hosting control panel.

You will have to add your public IP there to allow connection to the remote database. In this section you will also find the MySQL remote hostnamewhich we will need later.

  • Host: Enter your public IP address.
  • Database: Select the MySQL database to connect to.

When you have entered all the data, press To create and you will see a confirmation message like this:

After that, remote database access will work in a few seconds.

See also  Looking for a WordPress comment plugin? We give you 9 alternatives

Step 2 – Gathering information about the MySQL database

Second, you’ll need the database information. You can get the required credentials in the section MySQL databases on the control panel.

Since we already identified the MySQL remote hostname in the previous step, now we will only need the database name and the Username.

That is all! We now have everything we need to start configuring the HeidiSQL client.

Step 3 – Configuring the HeidiSQL client

Open the database client and click New to create an entry.

Next, you’ll need to give the entry a name and complete the MySQL database setup.

Make sure to complete the following fields:

  • Network Type: Select MySQL (TCP/IP).
  • Hostname / IP: Enter the hostname / IP MySQL remote hostname found in step 1 of this tutorial.
  • User – Enter the MySQL database user located in step 2.
  • Password: Type the user’s password.
  • Port – The default MySQL port for local and remote connections is 3306.
  • Databases – Enter the name of the MySQL database found in step 2.

When you’re ready, press the button Open and you will be inside your database.

Congratulations! You can now access your databases remotely using a HeidiSQL client.

Solutions to common problems with the HeidiSQL connection

Sometimes bugs occur that can cause the HeidiSQL client to display errors. Let’s take a look at some of the most common ones and see how we can fix them.

Can’t connect to MySQL server

This error occurs when the wrong MySQL port is used. Usually it looks like this:

To fix this, check the port number in your HeidiSQL configuration. On , this value is 3306. You can also contact your hosting provider as this value may vary.

See also  How to set mod_rewrite

Unknown MySQL server

The following error can occur due to an incorrect MySQL hostname. It is displayed like this:

To get rid of it, check that the MySQL remote hostname is correct. On , you can locate it in the section MySQL Remote from the hosting panel.

User access denied

This error can come in different forms and is related to incorrect details or missing IP entries in the section MySQL Remote. Here is a version of this:

If you see this error, try one of these 3 solutions:

  1. Check if you added the correct IP address in the section MySQL Remote. Start by looking up your IP address again using any online tool. Also, a dynamic IP address could be the cause, as it changes after a certain time.
  2. Make sure the MySQL user is correct. You can check it in the section MySQL Databases.
  3. Double check the MySQL user password. You can reset it through the section of MySQL databases. Optionally, if you’re trying to connect to your WordPress database, you can identify the current password in the file wp-config.php.

The error could also look like this:

This indicates that your database name is incorrect. Double check the name in the section of MySQL databases and update the HeidiSQL client configuration. As a result, you should have no problem managing your database.

final words

In short, there are several database management tools that can help you increase the efficiency of your work. In this tutorial, we have learned how to set up a remote MySQL connection via the HeidiSQL client and how to troubleshoot various basic connection issues.

See also  How to manage and list services in Linux

Do you have any questions, tips or ideas to share? We invite you to do so in the comments area!

Gustavo is passionate about creating websites. He focuses on the application of SEO strategies at for Spain and Latin America, as well as the creation of high-level content. When he is not applying new WordPress tricks you can find him playing the guitar, traveling or taking an online course.

Loading Facebook Comments ...
Loading Disqus Comments ...