Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Isaac Russell
Isaac Russell
12,091 Points

How do I know which table (in phpmyadmin) corresponds to which website?

I'm trying to export a table in phpmyadmin but I don't know which one to choose because they are named very similar.

Is there a way to know which table corresponds to which wordpress website?

2 Answers

You can check the database name in your wp-config.php file via FTP client. This file is located in your website's root directory.

Open the file in your favorite text editor and find the line that reads:

define('DB_NAME', 'this_is_your_database_name');

Then pick the database in your phpMyAdmin and export the database called this_is_my_database_name

If you are using only one database with multiple WP installation, you are probably using different table prefixes for each installation. In that case find the line that reads this:

$table_prefix  = 'wp_';

The "wp_" is in this case the used prefix. Any tables within the database where the table titles are prefixed with "wp_ " belong to that WP installation.

Best wishes Saskia

Isaac Russell
Isaac Russell
12,091 Points

Thanks Saskia, Your answer worked!

Sue Dough
Sue Dough
35,800 Points

Another way would be to check the database table wp_options in phpMyAdmin. There is a value called siteurl in the option_name column and it is usually the first row in the table. You will see something like http://yourdomain.com next to that in the option_value column.

Sue Dough
Sue Dough
35,800 Points

But please note that you could have an old database that has those values that is not your actual database. Saskia mentioned the safest alternative by checking the wp-config file.