HostBari
Sign inCreate account

Connect to your MySQL database

Local connections, remote access and why your host is localhost.

Updated 29 Aug 2026

Applications on your hosting account connect with localhost — the database runs on the same node, so no network hop is involved and no firewall rule is needed.

For a connection from your own machine, add your IP under Remote MySQL first. The control panel that holds it opens from the account rather than from an address of its own:

Access is IP-restricted by default because an open MySQL port is scanned within minutes of being exposed.

Why is the host localhost and not an IP address?

Because the database is on the same server as the site. localhost never leaves the machine, so the connection cannot be intercepted and does not spend a firewall rule. A tutorial that tells you to put a public IP there is written for a setup where the database is somewhere else, and copying it makes the connection slower and reachable from outside.

I lost the credentials — what now?

Reset the password on the existing user rather than creating a second one. Orphaned users accumulate, and they are a common source of backups that appear to run and restore into nothing. Credentials are shown once, when the database is created; if the reset does not help, send us the database name and we will look.

Was this helpful?

Related guides

Did this answer the question?

If not, open a ticket — a person will read it.

Contact support
Connect to your MySQL database on HostBari · HostBari