How to Connect to Your DirectAdmin Database From Another Computer (Remote MySQL)
Last updated Changelog
On this page
Your databases only accept connections from your own hosting. To use one from somewhere else, such as an app like HeidiSQL, DBeaver or MySQL Workbench on your computer, or a website on another server, allow that IP address first. In DirectAdmin you do this for each database user. In this example we allow our app server, 162.244.93.6.
Allow an IP address
-
Find the IP address you’ll connect from. For your own computer, search for “what is my IP” in your browser. For another server, check with whoever hosts it.
-
Log in to DirectAdmin and click Databases in Account Manager.

-
Click MANAGE USERS.

-
Click Manage next to the database user your app logs in with. The Allowed Hosts column shows where it can connect from now.

-
Scroll down to Allowed Hosts. Type the IP address into Allow access from and click Add Host.

Warning: Avoid adding
%. It lets anyone on the internet try to log in with this user. -
You’ll see User hosts have been successfully changed, and the address is listed. Leave localhost in place: your website needs it.

If your app uses more than one database user, add the address to each of them. To remove access later, click Remove next to the address, then YES.
Connect to your database
Use these details in your app:
| Setting | What to use |
|---|---|
| Host | Your server’s name: the address you log in to DirectAdmin with, without :2222. For example lv-shared02.dapanel.net |
| Port | 3306 |
| Database | The full name, with your username in front, for example directad70_shop |
| Username and password | The database user’s, for example directad70_shop. See Create a database. |
In our test, our app server was refused before step 5 and connected straight away after it.
Troubleshooting
| Problem | What to do |
|---|---|
Access denied for user 'directad70_shop'@'…' |
The part after the @ shows where our server sees you connecting from. If it isn’t the address you allowed, allow that one too. If it is, check the username and password. |
| The connection times out | Check the Port is 3306, and that your network or office firewall allows outgoing connections on that port. |
| It worked yesterday but not today | Your home or office IP address may have changed. Check it again and add the new one. |
| It works for one user but not another | Allowed hosts are set for each database user. Add the address to the other user too. |
Snagged on something? Contact support and we’ll get you sorted.