Get a free website with any plan

See how
CPANEL

What is my MySQL hostname?

Last updated

IN SHORT

On Flashcloud shared hosting, your MySQL hostname is localhost for any website or script running on your hosting account. Use localhost in application configs like WordPress. You only need your actual server hostname and a remote IP rule when connecting from an outside machine or desktop database client.

On shared hosting your MySQL hostname is almost always localhost: your WordPress install, PHP application, or any script running on your own hosting account connects to the database on the same server, so localhost is correct and it's also what any install wizard (including the WordPress installer) will default to.

You only need something other than localhost if you're connecting from outside your hosting account, for example a local dev machine, a separate server, or a desktop database client. In that case you need remote database access settings and your account's actual server hostname, not localhost.

Where to find your database credentials

Log in to portal.flashcloud.com, open your hosting service, and click the MySQL Databases tile. New databases and users are created in cPanel's Manage My Databases or Database Wizard tools (reached via one-click cPanel login from the portal).

For your wp-config.php file or any application config, the four values you need are:

  • DB_HOST: localhost
  • DB_NAME: the database name shown on the MySQL Databases tile
  • DB_USER: the database user shown on the MySQL Databases tile
  • DB_PASSWORD: set when you created the database user

If you're not sure which database a WordPress site is using, check the existing wp-config.php in File Manager before creating a new one.

Connecting to phpMyAdmin

You don't need a hostname at all for this. Use the one-click phpMyAdmin login from the portal's Services page and it opens already authenticated against the right server. This is a fast way to browse tables, run a query, or export a database without touching connection details manually.

Connecting remotely (local dev, external app, or a desktop client)

If you're connecting from a machine that isn't your hosting account, for instance MySQL Workbench, TablePlus, or a Node/Python app running elsewhere, you need three things:

  1. A remote-access entry for your IP address, added in cPanel's Remote Database Access tool. Without this, the server will refuse the connection no matter how correct your credentials are.
  2. Your account's actual server hostname (not localhost). Open a support ticket if you're not sure what it is.
  3. Port 3306 unless your client defaults to it already.

A quick way to sanity check the hostname from a terminal: ping yourserverhostname resolves it to an IP, and mysql -h yourserverhostname -u dbuser -p tests the actual connection. If the connection times out, the remote-access entry is the first thing to check, not the hostname itself.

Why "localhost" trips people up

It looks wrong because you're managing the site from a browser on your own computer, so it's natural to assume the database needs your computer's address or the site's domain name. But localhost refers to the server your database actually lives on, which is also where your PHP code runs. The application and the database are on the same machine, so they talk to each other internally without ever going out to the public internet. That's also why it's faster and more secure than a remote connection: no external network hop, no need to open the database port publicly.

When to contact support

If remote database access is configured correctly and you're still getting connection refused or access denied errors, or you're not sure whether a given app requires a remote connection at all, open a ticket from Support in the portal. Include the exact error message and whether you're connecting from your own computer or from another server.

Common questions

Can I connect from my computer using localhost?

No, localhost only works for scripts running on the server itself. To connect remotely from a desktop client, use your actual server hostname and port 3306.

Why is my remote database connection timing out?

Your IP address is likely missing from cPanel. The server refuses all external connections until you add your IP in the Remote Database Access tool.

Where do I see my database name and username?

Log in to portal.flashcloud.com, open your hosting service, and check the MySQL Databases tile. For existing WordPress sites, you can also view these details in wp-config.php via File Manager.

Do I need a hostname to use phpMyAdmin?

No, phpMyAdmin does not require a hostname or manual credentials. Log in through the one-click phpMyAdmin link on the portal Services page to connect automatically.

CAN'T FIND IT?

Real humans answer fast.

Hosting with us? Open a ticket and a real person replies - no scripts, no upsells. Still choosing a host? The same team is included with every plan, from day one.