MySQL

How to Use HeidiSQL to Connect to a MySQL Database

heidisql-remote-mysql-database-connection

Introduction

HeidiSQL is an all-in-one tool for database management, development, and administration. You may use HeidiSQL to remotely connect to a database created here on Hostinger. While our web hosting plans offer phpMyadmin to help with database management, HeidiSQL is the preferred choice for many developers. Using it can greatly speed up development. The remote MySQL connection made via your local machine will let you apply new updates and changes quicker, thus saving you the trip to the web hosting control panel.

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

  1. HeidiSQL client
  2. Remote MySQL entry for your IP address
  3. MySQL database credentials

We assume you already have a HeidiSQL client installed on your local machine. So we will begin by explaining the steps to access a MySQL database created on Hostinger.

Step 1 – Allowing a Remote MySQL connection from your IP address

Firstly, locate your IP address using any online tool. One way to get it is by typing `what is my IP` in Google search engine. Here’s an example:

locating-public-ip-address

Next, navigate to Remote MySQL section in your web hosting control panel.

remote-mysql-in-hostinger

You will need to add your public IP there to allow the remote database connection. In this section you’ll also find the remote MySQL hostname, which we will need later.

adding-ip-to-remote-mysql
The MySQL server hostname shown here will be required when connecting via HeidiSQL
  • Host – enter your public IP address.
  • Database – select the MySQL database that you will connect to.

Once everything is filled in, press Create and you will see a confirmation message.

remote-database-access-granted

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

 

Step 2 – Gathering MySQL database details

Secondly, you will need the database information. You can get the required credentials in MySQL Databases section in the control panel.

mysql-databases-section

Since we already located the remote MySQL hostname in the previous step, we will only need the database name and user.

database-credentials

Looking for a better way to host your website?

Transfer your website to the fastest web hosting platform with 24/7 dedicated support.

That’s all! We now have all we need to start configuring the HeidiSQL client.

 

Step 3 – Configuring HeidiSQL client

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

new-connection-in-heidisql-client

Then, you will need to name the entry and fill in the MySQL database configuration.

heidisql-completed-db-configuration

Make sure to complete the following fields:

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

Once done, press the Open button and you’ll be inside your database.

heidisql-client-connection-success

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

Troubleshooting common HeidiSQL connection errors

Sometimes mistakes or mistypes happen that can cause HeidiSQL client to show errors. Let’s discuss a few common ones and see how we can fix them.

Can’t connect to MySQL server

The error occurs when using an incorrect MySQL port. It usually looks like this:

heidisql-cant-connect-to-mysql-server

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

Unknown MySQL server host

The following error can happen due to incorrect MySQL hostname. It’s displayed as:

heidisql-unknown-mysql-server-host

To get rid of it, double check if your remote MySQL hostname value is correct. On Hostinger, you may locate it in Remote MySQL section of the hosting panel.

Access denied for user

This error can come in different forms and relates to incorrect details or missing IP entry in Remote MySQL section. Here’s one version of it:

heidisql-access-denied-for-user

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

  1. Double check if you added the correct IP address in Remote MySQL section. Start by looking up your IP address once again using any online tool. Furthermore, a dynamic IP address can cause this, as it changes after a period of time.
  2. Make sure the MySQL user is correct. You can double check it in MySQL Databases section.
  3. Re-check the MySQL user password. You may reset it via MySQL Databases section. Alternatively, if you are trying to reach your WordPress database, you may locate its current password in the wp-config.php file. Here’s a tutorial that provides more information on the topic.

The error may also look like this:

heidisql-access-denied-for-user-to-database

This indicates that your database name is wrong. Re-check the name in MySQL Databases section and update your HeidiSQL client configuration. As a result, you should have no problem managing your database.

Final Word

To sum up, there are various database management tools that can increase your work efficiency. In this tutorial, we have learned how to set up a remote MySQL connection via HeidiSQL client and fix basic connection issues.

Also, do you have any questions, tips, or ideas to share? You are welcome to do so in the comments below!

Add Comment

Click here to post a comment

Join thousands of subscribers worldwide

and get awesome deals & the newest tutorials to your email

Please wait...

Thank you for sign up!

More in MySQL
Difference Between MySQL and SQL Server
Difference Between MySQL and SQL Server

Close