InMotion Hosting Support Center

If you need to connect to your database using third party software that does not run on the server, such as a MySQL client on your desktop a remote MySQL connection can be made. First you will have to allow the connection from within cPanel for the IP address you are connecting from. 

What program do I use to connect Remotely?

There are a few programs you can use to connect remotely to your database. HTML editors like DreamWeaver can connect to your databases remotely as well. There are Free Open Source programs you can use like MySQL Workbench or or Heidi SQL. Below are some links to programs you can use to connect to your databases remotely.

Adding an IP address to allow a remote MySQL connection

First, you will need to make sure you have the IP address that will be accessing the database. These rules protect the database by only accepting external connections that you have set up. If you are connecting to a database from your current connection, you can obtain your current IP address by visiting this link: current IP address. Once you have the IP address that you wish to connect remotely from, follow these steps.

  1. Log into cPanel.
  2. Click the Remote MySQL button in the Databases section.
  3. Enter the remote IP address in the Add Access Host section.
  4. Click the Add Host button.

    You will then see a message stating the host IP address was added to the access list.

Now, since you have added the IP address to remote MySQL connections you will be able to connect to the databases. You can add as many IP addresses as you need.

Using a Wildcard to allow all IP's

You may find you need to use a wildcard if your IP address changes regularly. You can add a wildcard by using the % symbol. This will add all IP addresses in that range.

If you want to list all IP addresses in the range to you'd add the IP address 174.77.92.%.

Troubleshooting Remote connection issues

If you are using your preferred remote connection tool and suddenly it will not connect. This error is known as a 1045 and usually reads similar to '1045 - access denied for user'. If you are getting this error, there are a couple of things listed below that you may want to check.

Check your cPanel password

Many people connect remotely using their cPanel username and password as opposed to creating a single administrative user to add to the databases. This is not the preferred method, however if you do use the cPanel username and you are now getting a connection error, chances are you recently changed the cPanel password and have not changed it in the Remote connection software settings. Change the password there and you should be able to connect once again.

Check to see if connecting IP has changed

Not all of us are blessed with static IP addresses. From time to time your ISP (Internet Service Provider) may change your public IP address. If that is the case, you may find yourself unable to connect remotely via your preferred software. First, check your IP address by going to and searching for the term IP. You can also find your current IP address by clicking here.

Once you know your current IP address, go back and make sure that it is in the list of allowed IP addresses for your Remote MySQL settings. If you find it was not in the list and add the new one, you should then be able to connect remotely.

If you need further assistance with connecting to a database remotely please contact our support department

Support Center Login

Social Media Login

Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
connection with mysql database
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
2012-11-12 6:40 pm
You should mention how we find out HOW to access our MySQL databases from the remote location? What address do we use from the remote location to access the MySQL database?
35,822 Points
2012-11-12 7:18 pm
Hello Airquality,

Apologies, but this is a general article about making a remote connection to a database. Access to the database is generally based on the URL used to get to the server, and the user name and password assigned to the database you're trying to access. You will need to provide your IP address in order to allow the access through the firewall. This access is ONLY for database access (which occurs by default through a specific port). All of this is determined the Remote MySQL setup.

If you have any further questions, please contact technical support or leave a comment at the bottom of the page.


Arnel C.
2013-09-18 12:14 am
As you said use % as Wildcard then , how to allow all remote connection ?
11,186 Points
2013-09-18 8:37 am
If you want to allow all IP addresses to connect to a remote MySQL server, you would use wildwards such as %.%.%.% which would allow any IP address to connect. Doing so, however, is a very large security risk and I highly recommend against it.
n/a Points
2014-04-18 6:32 am

I'm trying to synchronize data tables  local install (mamp)  phpmysqladmin and it failes. I'm unable to troblehoot with telnet connection.

Upon telneting to my site, it ask only for password and not a username.  I already assigned username and password for specific database.  Which password is it waiting for? cpanel, my domain login to inmotion, or something else? 

After several failed attempts, i'm not allowed connet back to my ip address and get a packet out of order.


The error message attempting to connect:

5.5.36-cll?r"L=*W\?*?<P]cZwg"n(mysql_native_password (mypasswordhere)!#08S01Got packets out of orderConnection closed by foreign host.

?Host '' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'Connection closed by foreign host.

Do i have the 'mysqladmin flush-hosts ability? It doesn't work in sql screen and looks like a command prompt from the unix shell.  I don't have access directly to that unix shell that i'm aware of.


Example Edited log below.

Joeys-MacAir:cgi-bin boun619$ telnet 70.39.999.999 3306Trying 70.39.999.999...Connected to character is '^]'.N5.5.36-cllf?=Z/z:Rm?(u6KVOh=9E-Rmysql_native_password

Connection closed by foreign host.


Any Ideas?


11,186 Points
2014-04-18 7:46 am
First, you will not be able to telnet into your account. You will have to use a remote MySQL connection instead. When logging in remotely, you will be using the username and password to the MySQL user that is accessing the database that you want to connect to. This is something that you would have created within cPanel. As for the flush-hosts issue, this is caused by too many bad connections to the server and would need to be resolved by contacting technical support.
n/a Points
2014-06-17 6:55 pm

This doesn't explain how to connect - i.e. what should the mysql_connect look like. I can't get it to work and all I can find are platitudes.

9,968 Points
2014-06-17 7:17 pm
Hello Ron,

This guide just covers how to allow a remote MySQL connection into the server. If you're looking for how to connect to MySQL from PHP, we do have a guide on connecting to MySQL with PHP that does go over mysql_connect with this bit of code in the second step of the guide:

$con = mysql_connect("localhost","inmoti6_myuser","mypassword");

Please let us know if you had any other questions at all.

- Jacob
n/a Points
2014-06-17 7:58 pm

I'm trying to do a remote mysql access - and I can't get it to work. There's obviously more to it than is explained here.

n/a Points
2014-06-17 8:14 pm

I know how to do a local connection. I can't get a remote connection to work

9,968 Points
2014-06-17 8:36 pm
Hello Ron,

What code are you trying to currently use, and is it resulting in any errors? Also are you allowing the remote IP address of the server that you're running your PHP script from? Because that's the one that will need to be added, and not your local IP if the PHP server is running from another server.

There is an explanation as well as examples of mysql_connect from the site.

If your script works locally but not remotely, I'd try this basic example:

$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
echo 'Connected successfully';

After ensuring that the localhost variable is set to the server that is hosting your MySQL database, and also that the mysql_user, and mysql_password settings are correct what error is it giving back after the Could not connect: text?

- Jacob
n/a Points
2015-09-05 11:02 am
what can i replace with localhost if i want to connect from local system to web-based database?
26,229 Points
2015-09-08 9:21 am
Hello hamid,

Thank you for contacting us. If you are connecting to a remote server, just use the domain as the hostname.

Such as:

If you have any further questions, feel free to post them below.

Thank you,
n/a Points
2014-06-17 8:42 pm

The error I'm getting is this:

Lost connection to MySQL server at 'reading initial communication packet', system error: 110

and yea the local connection works. What's this about a different password for remote connection? How do I find that?

9,968 Points
2014-06-17 9:24 pm
Hello again Ron,

I'd assume either the server address you're using, or the username and password are incorrect based off that error. Either that or possibly you have a local firewall running that is preventing the outbound connection on port 3306.

Yes you do need a different username / password typically for a remote connection. This would be the database username and password that you setup on the remote server. For instance you need to create and attach a database user to a database in order to remotely connect to it.

- Jacob
n/a Points
2014-06-30 8:45 am

Hello Jacob (or colleague)

I'm trying to connect to my remote MySQL database using a JAVA program (that I used to process data from a CSV file). It all works fine when I connect to my local database, but when I change the settings to access the remote database, I can't connect.  I discovered this morning that I don't have SSH access to the remote database; does this mean that I will not be able to connect remotely using my JAVA app? Will I have to use something like WorkBench or Heidi? (I have got PHPMyAdmin access through cPanel, but it would be much quicker to load the database directly from the JAVA app.)

Any help appreciated.

40,817 Points
2014-06-30 9:10 am
Hello Steve,

As long as your IP is added to the Remote MySQL Connection tool and the settings are correct, there should be no issue with you connecting to the database remotely. You may opt to use Workbench, NaviCat, or Heidi as well, but they require the same setup as your Java app would. It may be good to test with one of those other applications as well as part of the troubleshooting process.

Kindest Regards,
Scott M
n/a Points
2014-06-30 11:31 am

Thanks for the quick reply Scott.

I can connect fine through a dummy php page I uploaded (using an example on IMH site), but still can't connect using the JAVA app. Could you tell me what format the domain should be:-

Eg. "jdbc:mysql://"


40,817 Points
2014-06-30 11:56 am
Hello Steve,

Within the snippet you provided, have you tried using the IP address instead of the domain name? Also, are you adding /dbname at the end before you provide the username and password? It should appear something like this:
jdbc:mysql://, db_user, password

If not, please let me know any error text you are receiving as well.

Kindest Regards,
Scott M
n/a Points
2014-07-15 4:34 pm

String host= "jdbc:mysql://%.%.%.%/a21_senkwaepos";

String uname = "username";

String upass = "password";

        try {


            con = DriverManager.getConnection(host, uname, upass);

am having error messages with the connection to the database..

9,968 Points
2014-07-15 4:58 pm
Hello Fish,

What is the error that you're getting about problems connecting to the database? It's hard to troubleshoot without seeing your full code or the specific error. I would make sure to reference the connecting to MySQL using JDBC guide from MySQL.

Also you want to make sure that your host is a valid entry that your Java application can connect remotely to. So I'm not sure if you were just using jdbc:mysql://%.%.%.%/a21_senkwaepos as an example. But that needs to be a valid IP address or hostname:

String url = "jdbc:mysql://localhost/test";
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
Connection conn = DriverManager.getConnection (url, "username", "password");

- Jacob
n/a Points
2014-11-20 9:31 pm

Hello sir, i've make a remote database in cpanel on my hosting, but i cant acces thaint database both in heidi sql, navicat or from my program (written in C#). my program gimme error "Unable to connect to any of specified my sql host". Btw, i used mysql connector for .NET

10,077 Points
2014-11-21 9:15 am
Hello Agriirga,

Have you made you sure you added your IP address in cPanel as it instructed? If so can you provide us your domain so we may take a look into your account and try to replicate the error.

Kindest Regards,
TJ Edens
n/a Points
2014-12-22 3:38 am

already solved sir :). Thank you. My hosting provider has blocked the port for mysql, so i use simple web services in php to acces the DB.

Thank you...

n/a Points
2015-02-11 1:40 pm
I found it to be short and precise
n/a Points
2015-09-28 8:01 am

How to connect remote MySQL Server with Java Application through Internet ?

35,822 Points
2015-09-28 8:30 am
Hello Arun,

Thanks for the question about MySQL server and JAVA. This will require coding and we do not provide coding support as it is beyond our scope of support. However, we do try to point you in a direction that will help. Check out the official documentation for MYSQL connection using Java here.

If you have any further questions or comments, please let us know.

Arnel C.
n/a Points
2015-11-25 10:01 am

Can I add a Host like no-ip or dynamicDNS to access from my IP each time?


35,822 Points
2015-11-25 10:10 am
Hello Mauricio,

Thanks for the question. I'm not sure what you mean by "no-ip", unless you're saying to make the connection with a domain name - which can be done. You can't create a rule in the Remote MySQL connection to prevent no-IP connections. You can create ranges of IP addresses, but in general, you'll want to specify a specific IP address to access the MySQL database. Making it dynamic and allowing a large range of addresses may compromise the security of your database.

I hope this helps to answer your question, please let us know if you require any further assistance.

Arnel C.
n/a Points
2015-11-25 10:21 am

I mean a dynamic DNS service like that points a specific address to my real IP that is a dynamic one. It is a solution to dynamic addresses.

I want to put it in the "add host" field in remote mysql, can this be done?



35,822 Points
2015-11-25 2:34 pm
Hello Mauricio,

If the domain name is resolving so that it can be used on the internet, then it should connect. You would have to use the domain name in the Access Host area.

I hope this helps to answer your question, please let us know if you require any further assistance.

Arnel C.
n/a Points
2015-11-26 9:33 am

Thanks, In my case I have dynamic IP so I use no-ip to get a domain name, so the question is: Can I put that domain name and access to mysql in that way?

n/a Points
2016-03-08 3:30 am

I am trying to connect using Dreamweaver CC 2015 to mysql database.  I am getting the following error message:

Your php server doesn't have MySQL module loaded or you can't use the mysql_(p)connect function.

Any help would be greatly appreciated.

6,526 Points
2016-03-08 10:52 am
Sorry to hear you were having trouble making the mySQL connection. Were there any steps in the above article you had trouble with? Did you add your IP to cPanel to allow the connection?
n/a Points
2016-04-05 6:17 am


I am trying to set up Mysql database on my system. When i try to connect the database from another system, it gives an error " remote server not allows you to connect. Ask administrator to add your computer or use the % wildcard on the server host"

How do we use the wild card or add another system ? 


Thanks & Regards,



11,946 Points
2016-04-05 8:03 am
Hi Sinoj Cyraic,

It sounds like you didn't add the IP to the firewall, as outlined in the steps. I'd suggest trying that. If you still have problems, reaching out to support would be your best option. We can help you add it accordingly.

n/a Points
2016-05-11 1:47 pm


Can I use no-ip address when adding hosts? I doesn't seem to work.

for example: "" as a host



35,822 Points
2016-05-11 3:10 pm
Hello Maor Levy,

Access to the databases are done per IP address, so you need to have an IP address (or range of addresses) in order to make the remote connection. This is done due to security constraints.

If you have any further questions or comments, please let us know.

Arnel C.
n/a Points
2016-08-30 12:50 pm


You guys have been really helpful and responsive!  Thanks for many years of happy service :)

I am having using MySQLWorkbench and the remote connection.  I can get connected fine and do a command or two but then the connection goes away and I have reconnect again.  Is there a way to adjust the timeout on the remote connection?

Kind Regards,

Carol H.

6,526 Points
2016-08-30 1:09 pm
That is certainly strange. I've never encountered that kind of timeout with MySQLWorkbench. If you can monitor the system logs at the moment of disconnect you might find a cause, or at least an error code. Of course, if you are in a shared server, you would need to have Live Support check those logs.

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

42 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!