Best for · Web hosting
How to connect to a Hostinger database remotely (shared hosting and VPS)
- Last checked
- 5 sources, linked below
- By the vectaai team
We read every plan page. Paid links are labelled. Money never changes a ranking. How we pick.
Verdict Our pick
The bar guide has a call.

- On Hostinger web or cloud hosting, remote access is off by default: databases accept connections only from the same server.
Compared here
- 01Hostinger shared and cloud hosting (hPanel)
- 02Hostinger VPS
Short answer
On Hostinger web or cloud hosting, remote access is off by default: databases accept connections only from the same server. To turn it on, open hPanel, go to Websites, Manage site, Databases, open your database, and under External connections click Allow IP. Add your own IP address, then connect from your app or tool using the hostname shown there (it looks like srv123.hstgr.io), port 3306, and your full prefixed database name and username.
On a Hostinger VPS it is your own MySQL server: change bind-address, open port 3306 in the firewall for your IP only, and make sure the user is allowed to connect from your address. Do not pick "any IP address" unless you have to; Hostinger itself warns that then anyone with the username and password can connect. Below: both routes step by step, the errors, and when not to connect remotely at all.
Sponsored links. We may earn a commission; it never changes the pick.
At a glance
| Web or cloud hosting (hPanel) | VPS | |
|---|---|---|
| Default | Connections from the same server only | MySQL usually listens locally only |
| Where to switch it on | Databases, your database, External connections, Allow IP | MySQL config (bind-address) plus firewall |
| Hostname to use | The one in the Allow IP window, like srv123.hstgr.io | Your VPS IP address |
| Port | 3306 | 3306 unless you changed it |
| Lock it down by | Allowing one specific IP | Firewall rule for port 3306 from your IP only |
| Biggest warning | Any IP address: anyone with the login can connect | bind-address 0.0.0.0 opens it to every IPv4 address |
| Apps hosted on Hostinger | Use 127.0.0.1, not the remote hostname | Use 127.0.0.1 from the same server |
The money talk first. The Hostinger button goes through vectaai.com/go/hostinger and Hostinger may pay us if you buy a plan. This page is about a plan you already have, so there is not much to sell. It is here because the question comes up a lot and Hostinger's own answer is split over three pages.
And the honest bit: we did not connect to a live Hostinger database for this page. The steps come from Hostinger's support article, its databases docs, its remote access tutorial and its Node.js guide, read on 3 December 2026. Menu names move around in hPanel now and then; if yours look slightly different, look for the same words.
First: do you even need a remote connection?
A remote connection is for things outside Hostinger talking to your database: a desktop tool like MySQL Workbench, DBeaver or TablePlus, a script on your laptop, an app on another server, a reporting tool.
If your app is hosted on Hostinger, you do not need it. Hostinger's Node.js database guide says to use 127.0.0.1 as the host, and not the remote hostname, because "the remote hostname only works for connections from outside Hostinger." It also warns that using localhost instead of 127.0.0.1 causes an "Access denied for user ...@'::1'" error on Node.js 17 and newer. Fix that first; it is the most common mix-up.
If you just want to look at tables or run a query, phpMyAdmin in hPanel needs no remote access at all. Hostinger's databases docs say you click the phpMyAdmin button on the database row or its details page.
Route 1: web or cloud hosting (hPanel)
Hostinger's databases documentation is clear on the default: "Databases accept connections only from the same server by default." You switch it on per database.
Step by step
From Hostinger's remote MySQL support article:
- In hPanel, go to Websites, then Manage site, then Databases in the left sidebar.
- Click the arrow next to your database.
- In the External connections card, click Allow IP.
- Choose:
- Specific IP address: enter your IPv4 or IPv6 address. Search "what is my IP" from the computer that will connect, and use that.
- Any IP address: Hostinger's warning: "anyone with the database username and password can connect."
- Click Allow IP.
- Copy the Hostname (example from Hostinger: srv123.hstgr.io) or the server IP from the same window.
To revoke access later, the docs say to use Remove next to the IP.
Connection details
| Field | What to enter |
|---|---|
| Host | The Hostname from the Allow IP window, like srv123.hstgr.io |
| Port | 3306 |
| Username | The full username, including the prefix Hostinger adds |
| Password | The database user's password |
| Database | The full database name, including its prefix |
That prefix catches a lot of people. Hostinger's Node.js guide stresses using the full username and the full database name "including its prefix". If your username in hPanel looks like u123456789_shop, then "shop" alone will fail.
Test from the command line
The MySQL client command from Hostinger's tutorial:
mysql -u username -h mysql_server_ip -p
Swap in your full username and the hostname, enter the password when asked, then run SHOW DATABASES; to see your database. The MySQL manual explains the -u, -h and -p options if you want the details.
Connect with a desktop tool
MySQL Workbench, DBeaver, TablePlus and friends all ask for the same five fields from the table above. Create a new MySQL connection, paste them in, test. If the test hangs and times out rather than saying access denied, your IP is not allowed, or it changed since you added it.
Route 2: Hostinger VPS
On a VPS, MySQL is your own server, so there is no Allow IP button. Hostinger's remote access tutorial (last updated 20 December 2023) walks through it:
- Find the config file:
mysql --help | grep "Default options" -A 1 - Edit it, for example
nano /etc/my.cnf, and under[mysqld]setbind-addressto the right address. The tutorial warns: avoidbind-address=0.0.0.0, which "enables any IPv4 address to access the MySQL servers." - Remove or comment out
skip-networkingif present; with it active, MySQL does not listen for TCP connections at all. - Restart MySQL:
sudo systemctl restart mysql - Open port 3306 for your IP only. The tutorial's iptables example:
iptables -A INPUT -i eth0 -s remote_IP_address -p tcp --dport 3306 -j ACCEPT, then save the rules. It warns that leaving out-s remote_IP_address"opens port 3306 for unrestricted traffic." On a KVM VPS you can instead add a TCP rule for port 3306 with a custom source under Security, Firewall in hPanel. - Make sure the MySQL user may connect from your address. A user created as 'name'@'localhost' can only log in locally. The tutorial points to a separate article for creating users; the MySQL rule is that the host part of the account must match where you connect from.
- Test with the same
mysql -u ... -h ... -pcommand from your own machine.
Hostinger also recommends SSH for securing remote MySQL connections. With an SSH tunnel, MySQL stays closed to the internet and you connect through SSH instead. Most desktop database tools have an SSH tab for exactly this.
Errors and what they usually mean
| Symptom | Usual cause | Fix |
|---|---|---|
| Connection times out | IP not allowed, IP changed, or firewall closed (VPS) | Re-add your current IP; check the firewall rule |
| Access denied for user | Wrong password, missing prefix, or user not allowed from your host | Use the full prefixed username; check grants |
| Access denied ...@'::1' from a Hostinger app | Using localhost on Node.js 17+ | Use 127.0.0.1, per Hostinger's guide |
| Unknown database | Missing prefix in the database name | Use the full name from hPanel |
| Works at home, fails at the office | Different public IP | Allow the office IP too |
Hostinger's tutorial lists the same checks: is the MySQL service running (sudo service mysql status on VPS), can you ping the server, does the user have the right grants (SHOW GRANTS FOR 'username'@'localhost';), and are the hostname, username and password typed right.
Security, said plainly
Opening a database to the internet is like leaving your front door unlocked because you lost your keys once. Convenient, and an invitation.
- Allow one IP, not any IP. Hostinger's own warning on "any IP" is there for a reason.
- Remove entries you no longer use. That laptop from three jobs ago does not need access.
- Use a long random password for any user that can connect remotely, and never hardcode it in code you push to GitHub. Hostinger's Node.js guide says the same: "Never hardcode database credentials in your app."
- Prefer SSH tunnels on VPS. Port 3306 stays closed.
- Back up before you poke around. Remote tools make it easy to drop the wrong table at 1 a.m.
Related reading
If you are weighing Hostinger against other hosts, see Hostinger vs Namecheap and our guide to cloud hosting. For hosts that make databases and staging easier for WordPress, Hostinger vs GoDaddy covers the basics.
Questions people ask
How do I allow remote MySQL access on Hostinger?
In hPanel, open Websites, Manage site, then Databases. Click the arrow next to your database, and in the External connections card click Allow IP. Enter a specific IPv4 or IPv6 address, or choose any IP address, then click Allow IP. The same window shows the hostname and server IP to connect to. The port is 3306.
What is the hostname for a Hostinger remote database?
Hostinger shows it in the Allow IP window, with an example like srv123.hstgr.io, plus the server IP, each with a copy button. Use that hostname only from outside Hostinger. For an app hosted on Hostinger itself, its Node.js guide says to use 127.0.0.1, because the remote hostname only works for outside connections.
Why do I get Access denied when connecting remotely?
Usually one of four things: your IP is not on the allowed list or has changed, the username or database name is missing its prefix, the password is wrong, or the user lacks privileges. Hostinger's troubleshooting list says to recheck the hostname, username and password and to check the user's grants.
Is it safe to allow any IP address?
It is the riskiest option. Hostinger's own warning says that with any IP address, anyone with the database username and password can connect. Allow your specific IP instead, use a long random password, and remove the entry when you are done. If your home IP changes often, an SSH tunnel is safer than opening the door to everyone.
Can I connect to a Hostinger database with MySQL Workbench or DBeaver?
Yes, once your IP is allowed. Create a new MySQL connection, put the Hostinger hostname in the host field, port 3306, and your full prefixed username and password, then pick your database. If the connection times out, your IP is probably not allowed yet or has changed since you added it.
Sources
Every fact above comes from these pages. Prices change, so each one carries the date we read it.
- Hostinger support: How to set up remote MySQL access, checked 3 Dec 2026
- Hostinger docs: Databases, checked 3 Dec 2026
- Hostinger tutorial: How to grant MySQL remote access (updated 20 December 2023), checked 3 Dec 2026
- Hostinger support: Connecting a Hostinger MySQL database to a Node.js application, checked 3 Dec 2026
- MySQL documentation: Connecting to the server using command options, checked 3 Dec 2026