ThisCalculator

Everyday

Find Your WordPress Database Name (DB Name)

Updated · Standard formula, shown below

This guide shows you exactly how to locate your WordPress database name (DB name) in a few different ways. You’ll need access to your hosting control panel (like cPanel or Plesk) or an FTP client, plus your WordPress admin login. Knowing your database name is essential for troubleshooting, migrating your site, or configuring a staging environment.

What You’ll Need

  • Access to your hosting account (cPanel, Plesk, or similar).
  • Your WordPress admin credentials (username and password).
  • An FTP client (like FileZilla) if you prefer to check files directly.
  • A text editor (like Notepad or Sublime Text) for viewing files.

Step-by-Step

  1. Log in to your hosting control panel. This is usually at a URL like yourdomain.com/cpanel or provided by your host. If you’re not sure, check your host’s welcome email.
  2. Find the “Databases” section. In cPanel, look for “MySQL Databases” or “MySQL Database Wizard.” In Plesk, it’s under “Databases.” Click it.
  3. Look at the list of databases. You’ll see a table listing all databases associated with your account. The database name is often prefixed with your cPanel username (e.g., user_wpdb). If you have multiple databases, note the one that belongs to your WordPress site—often named something like wp_ or wordpress.
  4. If you can’t identify it, check your WordPress config file. Connect to your site via FTP or the File Manager in your hosting panel. Navigate to the root folder where WordPress is installed (often public_html or www).
  5. Look for a file named wp-config.php. This file contains your database settings. Download it or open it in the editor.
  6. Find the line that starts with define('DB_NAME',. The value in single quotes is your database name. For example: define('DB_NAME', 'my_wp_database'); — here the database name is my_wp_database.
  7. If you still can’t find it, use phpMyAdmin. In your hosting control panel, locate “phpMyAdmin” (often under “Databases”). Click it. On the left sidebar, you’ll see a list of databases. The one that’s not a system database (like information_schema or mysql) is likely your WordPress database.
  8. Alternatively, check your WordPress admin dashboard. Not all hosts show the database name here, but some plugins (like “WP-DB-Name” or “Database Viewer”) can display it. However, the simplest method remains the config file or hosting panel.

Common Mistakes

  • Confusing the database name with the database user. They are separate. The user is the name after DB_USER, while the database name is after DB_NAME.
  • Editing wp-config.php and breaking the site. Only view the file; don’t change anything unless you’re sure what you’re doing. Always back up the file first.
  • Looking in the wrong folder. If you have multiple WordPress installations, ensure you’re checking the correct root folder.
  • Assuming the database name is the same as your site’s domain. It might be, but often it’s prefixed with your hosting username or a random string.

Tips

  • Write down the database name and user. Keep them in a secure password manager. You’ll need them for migrations or troubleshooting.
  • Use the hosting panel first. It’s the most reliable and doesn’t require touching files.
  • If you’re using a managed WordPress host (like WP Engine or Kinsta), the database name might be visible in their custom dashboard under “Database Access” or “Environment.”
  • When checking wp-config.php, be careful not to accidentally upload a modified version. Use “View” or “Edit” but don’t save unless you made a change.

Troubleshooting

  • Can’t find wp-config.php? It might be hidden. In FTP clients, enable “Show hidden files.” In cPanel’s File Manager, click “Settings” and check “Show Hidden Files (dotfiles).”
  • You see multiple databases and don’t know which is yours. Try logging into phpMyAdmin and clicking on each database. Look for tables like wp_posts or wp_options. That’s your WordPress database.
  • You get a “Error establishing a database connection” after checking the config file. This usually means the database name, user, or password is wrong. Double-check the exact spelling and capitalization.
  • Your host doesn’t provide cPanel or phpMyAdmin. Contact their support; they can tell you the database name for your site.
  • You’re on a local development environment (like XAMPP or Local). The database name is usually defined in the local setup—often something like local or the site name.

Frequently Asked Questions

Is the database name the same as the database user?

No. They are separate. The database name is the name of the database itself, while the user is an account that has permissions to access it. In wp-config.php, they are defined separately as DB_NAME and DB_USER.

Can I change my WordPress database name?

Yes, but it’s not recommended unless you’re experienced. You’d need to rename the database in your hosting panel and update wp-config.php accordingly. Always back up your database first.

What if I don’t have access to cPanel or FTP?

If you only have WordPress admin access, you can install a plugin that displays database information, but this is less common. Your hosting provider’s support can also provide the database name.

Why do I need to know my database name?

It’s needed for troubleshooting database connection errors, migrating your site to a new host, setting up a staging site, or using certain plugins that require direct database access.

My database name has a prefix like “wp_”. Is that normal?

Yes, many hosts add a prefix (often your cPanel username) to avoid conflicts. The actual name might be something like user_wpdb. That’s fine.

Can I find the database name from the WordPress admin dashboard?

By default, no. The database name is not shown in the admin area for security reasons. You’ll need to check the config file or hosting panel.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.