I recently took over a website and I have missing tables in the civicrm database (under wordpress). I want look at the civicrm database but I don't know where the database is stored. How can I find the physical civicrm database file so I can download it and run some queries to see what's there? When I go to phpMyAdmin on the server, it only lists the wordpress database.

Below is what I see when I look at phpMyAdmin and this is the only db. I have looked at all of the table names in this db and there are no civicrm tables.


enter image description here

2 Answers 2


You can find the civicrm database listed in the civicrm.settings.php


Apart from that , you have two possibilities

1)Wordpress and Civicrm both use same database

2) Civicrm has separate database

If wordpress and civicrm has same database , you can search in wordpress database tables which have prefix civicrm_*

  • Thanks. That's what I thought, but there are no civicrm tables in the WP db. I found a database name in civicrm.settings.php, but I can't find a file with that name on the server. In theory, it shouldn't be that hard to find the file, but I don't know where I'm going wrong.
    – kzburn
    Commented Mar 4, 2018 at 16:37
  • If you want, I can help you figure that out.let me know
    – harshal
    Commented Mar 4, 2018 at 18:02
  • I would appreciate any suggestions.
    – kzburn
    Commented Mar 4, 2018 at 19:36
  • @kzburn, I would have helped if I ws able to access your environment
    – harshal
    Commented Mar 4, 2018 at 19:39
  • Hi @kzburn, check for r9Z99F_2_civicrm_* as prefix in your database list of tables
    – harshal
    Commented Mar 4, 2018 at 20:14

If you are sure you are in the correct database for your wordpress your civi is installed on, you should see this.

enter image description here


Go to wp-content/uploads/civicrm/civicrm.settings.php

Look for this line

if (!defined('CIVICRM_UF_DSN') && CIVICRM_UF !== 'UnitTests') {


  • When I go to phpMyAdmin, I only see one database.
    – kzburn
    Commented Mar 4, 2018 at 20:03
  • See my edits above. That should help you find your civi database location.
    – fdarn
    Commented Mar 5, 2018 at 13:24
  • Thanks.....I found that and I know the name of the database, but when I ftp to our server, there isn't a file there with that name. At least I'm on the right track. Thanks for your help!
    – kzburn
    Commented Mar 5, 2018 at 15:36
  • You won't see it with ftp, you would see it in phpmyadmin, but you might be logging in to phpmyadmin as a user that doesn't have access to the civi database. Use the user/pass that's listed in the CIVICRM_UF_DSN setting.
    – Demerit
    Commented Mar 6, 2018 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.