Skip to content

Finding your database details

Your website connects to its database with four details: the database name, the database username, the password and the host. You’ll need them when you set up an app by hand, move a site, or fix an “Error establishing a database connection” message.

On Ruachost hosting, the database host is almost always:

localhost

Use localhost for any website or app running on your hosting account. Only use your server’s hostname or IP address when you connect from outside the server, for example from a desktop database tool. That also needs remote MySQL access.

  1. Log in to cPanel.
  2. Under Databases, open Manage My Databases (called MySQL® Databases in some versions).
  3. Your databases are listed under Current Databases, with the users who can access each one.

cPanel adds your cPanel username and an underscore to the front of every database and user name. For example, if your cPanel username is ruach1 and you created a database called shop, its full name is ruach1_shop. Always use the full name in your website’s settings.

cPanel doesn’t show database passwords. If you don’t know it, set a new one:

  1. In Manage My Databases, scroll down to Current Users.
  2. Click Change Password next to the user.
  3. Enter a new password (or use the Password Generator) and click Change Password.
  4. Update the password in your website’s configuration file straight away, or the site won’t be able to connect.
Application File Settings
WordPress wp-config.php DB_NAME, DB_USER, DB_PASSWORD, DB_HOST
Joomla configuration.php $db, $user, $password, $host
Laravel .env DB_DATABASE, DB_USERNAME, DB_PASSWORD, DB_HOST

You can open and edit these files in File Manager. Some of them are hidden; see I can’t see (dot) htaccess to show hidden files.