Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which MySQL database is my WordPress install using?

I am working on a website for a client who has several websites on her web hosting account. I would like to move one of the websites, which is running on WordPress, to my localhost. But am having issues with the MySQL db and can't figure out which database the site is using.

The wp-config.php points to one database, but when I look at that same database in phpMyAdmin there are none of the common WordPress tables in there. Instead of the prefix wp_ there are a bunch of tables with the prefix cp_. I don't know what that means. There are other databases on the client's hosting account that have WordPress tables, but the wp_options tables for them all point to other site URLs, not the one I'm trying to work on.

How can I find out which database is being used?

like image 500
kanga Avatar asked Oct 07 '12 14:10

kanga


1 Answers

It's possible that the table prefix has been changed to cp_ instead of the standard wp_. Some installations do that to mitigate some types of SQL injection attacks. wp-config.php should always point to the real database which, in your case, should have table names like cp_posts, cp_postmeta, cp_options, etc.

Check for the $table_prefix variable in the config file, or it may be buried in some cPanel option somewhere.

like image 144
smitelli Avatar answered Sep 23 '22 16:09

smitelli