Need to enter the database tied to your WordPress website? No wonder, since it stores data your website needs to function. It’s also essential for organization, i.e., the structure of user data, site, plugin, and theme settings, as well as pages, posts, and various content. Finally, it’s pivotal to your website loading speed. When a user visits your website, their browser requests the necessary data from the server your website is hosted on. It delivers it from a database and displays it as a web page. However, sorting, navigating, and serving data manually would be hard. Therefore, we’ll mention the basics before we show you how to access the database in WordPress.
When did I create a database, and where is it?
This is a common question; many owners are unaware their WordPress database already exists. If it wasn’t for that, their website wouldn’t function properly. Now that it’s evident you already have a database, refer to the time you installed WordPress. You were asked for a database name and a prefix, which, if left by default, could be something like “public_html” or “root”, with a “wp_” prefix. This changes if you used 1-click installers or had your hosting finish the installation instead. Moreover, WordPress lets you select an existing database, so that should be considered, too. Either way, a database exists, usually on the same server that your web hosting provided.
Do I need special software to access the WordPress database?
Yes, you require dedicated software, called a database management system (DBMS), to access and modify databases. Further, the content of the database is arranged adhering to the rules of the SQL (Structured Query Language), and WordPress frequently relies on two DBMS: MySQL and MariaDB. You’ll mainly interact with the database in two ways:
- Sending queries: Written instructions akin to commands that tell the DMBS which database, table, row, column, and field will be involved and how they should be changed.
- Using a database manager: Web or computer/mobile software with UI (user interface) that provides a visual representation of the database content. It’s vastly more user-friendly and permits extra functionality, such as doing a dry to run to ensure there are no query errors. It also lets you do things query can’t, e.g., altering the username of your account.
How does WordPress organize database data?
As we mentioned, it wouldn’t make sense to store data haphazardly. Hence, database data is organized in a predetermined way, using categories, more precisely tables inside a database, each dedicated to a portion of WordPress functionality. Furthermore, each table consists of columns and rows, as well as fields where the two intersect. With that, we’ll tell you what you will see after you employ either of the two methods below. If you haven’t altered the prefix and your host didn’t make any changes, a new WordPress website will have these tables:
1. Access your WordPress database using phpMyAdmin
Before we start, know you aren’t hard-pressed to utilize databases. Many WordPress website owners, especially when starting, use the Admin Section and FTP access to accomplish all they need. You may also contact hosting’s Customer Support if you’re unsure—it’s there for a reason. Because the consequences can be serious, we suggest opening your database in 3 cases:
- When you want to study the structure of your website data
- If what you need to do has no alternative
- Troubleshooting uncomplicated issues, such as insufficient permissions for folders and files, or minor tweaks
1. Launching phpMyAdmin on the web
Though some web hosting providers employ a custom control panel while others stick to the renowned open-source cPanel, they frequently agree on using the same web-based SQL administration tool, phpMyAdmin. Therefore, the user interface will remain consistent irrespective of the web hosting provider. Follow these instructions to gain WordPress database access via phpMyAdmin:
- Head over to your hosting’s website, and access the control panel.
- Sign in, and search for the “Databases” section or a tab.
- Once you find it, select phpMyAdmin or Open phpMyAdmin.
- You’ll now need to select the language from the drop-down list unless it’s English.
- Enter your database username and password. If you aren’t sure, you have 3 choices for checking the username and password for a WordPress database:
- Check the cPanel. Many web hosting providers supply these details at a glance. Look for an option titled Database access or something similar.
- Open the wp-config.php file. It’s located in the root of your website after gaining access via FTP. Look for lines
define( 'DB_USER', 'this_is_your_username' );and
define( 'DB_PASSWORD', 'this_is_your_password' );
- Contacting hosting support. Representatives can provide these details at a moment’s notice, especially if they offer 24×7 live chat.
Note. This is an ideal opportunity to double-check which database belongs to your website, especially if you have several. You can do so from the same steps, except you should open File Manager under “Files” in cPanel in method 1 or check the line
"define('DB_NAME', 'wp_database_name'); in method 2. The third is identical.
2. Viewing the database and making changes
Now that you’re in, turn your attention to databases on the left-hand side. Click the one you determined belongs to your website. You’ll now see a list of tables in the larger section on the right-hand side. Alternatively, click the + icon next to the database name on the left-hand side. You’ll now see a list of options in the “Action” column and can click the table name to open it. If you need to run queries, click the Query tab in the top menu.
2. Using SQL software to enter your database for WordPress
If you’re hosting WordPress locally and haven’t installed cPanel or an alternative, an online approach won’t work. Thankfully, there’s an alternative in the form of software for computers and mobile devices. We have no affiliation or a favorite, but besides phpMyAdmin (which you can install locally), a few well-known names are MySQL Workbench, HeidiSQL, Microsoft SQL Server Management Studio (SSMS), and Navicat. The only notable difference is during the sign-in process—you’ll have to enter a hostname. Luckily, you can find it in the same places as database name, username, and password. Check the
define( 'DB_HOST', 'your_hostname' ); line. If it mentions a port, such as localhost:3307, you’ll need to enter that, too.