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.
Database host
Section titled “Database host”On Ruachost hosting, the database host is almost always:
localhostUse 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.
Database name and username
Section titled “Database name and username”- Log in to cPanel.
- Under Databases, open Manage My Databases (called MySQL® Databases in some versions).
- 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.
Database password
Section titled “Database password”cPanel doesn’t show database passwords. If you don’t know it, set a new one:
- In Manage My Databases, scroll down to Current Users.
- Click Change Password next to the user.
- Enter a new password (or use the Password Generator) and click Change Password.
- Update the password in your website’s configuration file straight away, or the site won’t be able to connect.
Where your website stores these details
Section titled “Where your website stores these details”| 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.