InMotion Hosting Support Center

There may come a time where you will need to know your specific database name for your Drupal 8 website. Perhaps you need to connect to it via a remote MySQL program to take a look at some tables, or maybe you are in the middle of transferring a site and need to know what database to move.

If you used an autoinstaller such as Softaculous or Fantastico to install Drupal you may have used the default database name and not paid much attention to it. You may also not have been the person to initially set up the site and have never seen the database name.

If your hosting account has only one database in it, finding the name will not be an issue, but if you have multiple databases installed on the account, narrowing down which one is in use for your specific Drupal site can be more difficult. In this article, we will describe how to find the name of the database that your Drupal 8 site is using.

How to find your Drupal 8 database name

  1. Log into your cPanel dashboard.
  2. From the main cPanel page, locate the File Manager tool under the Files category and click on it.
  3. Now that you are in the File Manager, you will need to access the root folder for your Drupal site. This can be different depending on whether your Drupal is installed as your main domain, an addon domani, or a sub domain. Below is a table to give you the format of the folder you will need to look for. The vast majority will be using the main domain, followed by addon, and the least likely subdomain.
    main sitepublic_html
    addon domainpublic_html/
  4. Once you have found your root folder and opened it, you will need to look for the configuration file. This is located under the sites and then default folders. Assuming that Drupal is installed on your main site, you would need to look under the "public_html/sites/default" folder path. Once you have opened the default folder, look for a file named settings.php. Open the file in edit mode.
  5. Settings.php file Once in the editor you will need to find the actual lines that have the database settings. The vast majority of the lines are commented out, so look towards the bottom of the file. In Drupal 8 (as of Alpha 7) the settings appear around line 670. You will see a line of code that appears like this:
    'database' => 'userna5_testdb',
    The database name itself has two portions. The first portion 'userna5' is your cPanel username and the second part 'testdb' is the actual database name.
  6. Once you find the database name, be sure to notate it in a safe place so it is easily found when you need it. This will be most commonly useful when working with database admin programs such as phpMyAdmin or remote database connection managers.
Was this article helpful?
Continued Education in Course Drupal 8
You are viewing Section 1: 309: Locating your database name in Drupal 8
Section 2: 310: Changing the Maintenance Mode Message in Drupal 8

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!