Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Manage Your WordPress Database with phpMyAdmin

This guide shows how to open your WordPress database in phpMyAdmin, back it up, and do a few common tasks safely.

Databases2 min read20 steps16 screenshots

What is the WordPress database?

WordPress keeps your posts, pages, comments, users and settings in a database. A database is a store of information made of tables. Your theme and image files are not inside it, only the text and settings.

Screenshot: WordPress keeps your posts, pages, comments, users and settings in a database. A database

phpMyAdmin is a web tool for looking inside a database. Take a backup before you change anything here, because a wrong edit can break your site.

Find your database name

  1. Open File Manager in cPanel.
  2. Open the file wp-config.php in your WordPress folder.
  3. Find the line with DB_NAME. The name beside it is your database.

Open phpMyAdmin

  1. Log in to cPanel.
  2. In the Databases section, click phpMyAdmin.
    Screenshot: In the Databases section, click phpMyAdmin .
    Screenshot: In the Databases section, click phpMyAdmin .
  3. Click your database name in the left list.

You will see tables such as wp_posts, wp_users and wp_options. The start of the name (wp_) is the table prefix and can differ on your site.

Back up the database

  1. With your database selected, click the Export tab.
    Screenshot: With your database selected, click the Export tab.
    Screenshot: With your database selected, click the Export tab.
  2. Keep Quick and the SQL format.
  3. Click Export.
  4. Save the downloaded file in a safe place.
    Screenshot: Save the downloaded file in a safe place.

Reset a lost admin password

  1. Click the wp_users table.
    Screenshot: Click the wp_users table.
    Screenshot: Click the wp_users table.
  2. Click Edit beside your admin user.
    Screenshot: Click Edit beside your admin user.
  3. In the user_pass row, open the Function drop-down and choose MD5.
    Screenshot: In the user_pass row, open the Function drop-down and choose MD5 .
  4. Type your new password in the Value box.
  5. Click Go.

WordPress will then convert it to a stronger form the first time you log in.

Fix a wrong site address

  1. Open the wp_options table.
  2. Find the rows siteurl and home.
    Screenshot: Find the rows siteurl and home .
  3. Click Edit, fix the address, and click Go.

Clean up and speed up

  1. Tick the tables on the main database page.
  2. In the With selected menu, choose Optimize table.
    Screenshot: In the With selected menu, choose Optimize table .
    Screenshot: In the With selected menu, choose Optimize table .

This tidies the tables and recovers wasted space. You can also use a WordPress plugin to delete old revisions and spam comments.

Screenshot: This tidies the tables and recovers wasted space. You can also use a WordPress plugin to d

Repair tables

If WordPress shows database errors, tick the tables and choose Repair table in the same menu.

Screenshot: If WordPress shows database errors, tick the tables and choose Repair table in the same me
Warning: The Drop and Empty options delete data for good. Never use them on WordPress tables unless you have a backup and know why.

Quick recap

  • WordPress stores posts and settings in a database.
  • Find the name in wp-config.php and open phpMyAdmin from cPanel.
  • Use Export to back up first.
    Screenshot: Use Export to back up first.
  • Common tasks: reset a password in wp_users, fix addresses in wp_options.
  • Use Optimize and Repair for upkeep. Avoid Drop and Empty.