I followed the instructions for getting Views working with Drupal but it's not working in Backdrop. I see:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'database_name.civicrm_contact' doesn't exist

2 Answers 2


Getting Views working with Backdrop is essentially the same as getting Views working with Drupal, although there can be one extra step. So first, follow these instructions to get CiviCRM's tables into Views.

Regarding the possible second step, Backdrop by default uses a simplified structure to specify database credentials (more). This will not cause a problem if you are using the same database for CiviCRM and Backdrop and you do not have a second step.

If, however, you have CiviCRM in a separate database, you need to adjust your Backdrop settings.php in one additional way, changing the default/simplified database string...

$database = 'mysql://user:pass@localhost/database_name';

...to allow multiple databases:

$databases['default']['default'] = array(
  'driver' => 'mysql',
  'database' => 'database_name',
  'username' => 'user',
  'password' => 'pass',
  'host' => 'localhost',

@colemanw's note from the Drupal answer applies here, too: "if your [Backdrop] sql user and CiviCRM sql user are different then you need to grant SELECT privileges to the [Backdrop] one for the CiviCRM db."


I can't comment on the other answer (I don't have enough reputation), but here are some additional information suggestions:


I got it working with these two changes:

  1. We made this change:
OLD:    $database_prefix = array(
NEW:    $databases['default']['default']['prefix']= array(
  1. We removed the backticks on all the table items we had pasted into the settings.php file:
OLD:    'civicrm_view_case_activity_recent'        => '`tcog2_civicrm`.',
NEW:    'civicrm_view_case_activity_recent'        => 'tcog2_civicrm.',
  • Can you paste the relevant bits into your answer directly?
    – Laryn
    Mar 19, 2021 at 22:45
  • Added additional details. Thanks for suggestion. Mar 19, 2021 at 22:58

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.