Answers.Body: <p>Remove ` symbol added to the database name in settings.php</p>
  <p>eg</p>
  <pre><code>$databases['default']['default']['prefix']= array(
    'default' =&gt; '',
    'civicrm_acl'                              =&gt; '`civicrm_prod`.', ...
  </code></pre>
  <p>change to</p>
  <pre><code>$databases['default']['default']['prefix']= array(
    'default' =&gt; '',
    'civicrm_acl'                              =&gt; 'civicrm_prod.', ...
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-22T05:31:12.943Z
Answers.Text: Wow, thank you!.  I do not know how that happened, I just copied and pasted from the CiviCRM CMS page.
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-21T04:47:20.313Z
Answers.LastActivityDate: 2021-06-21T04:47:20.313Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I have my Drupal 9 database and my CiviCRM database in two separate databases on the same Amazon MySQL Aurora instance. The setup in our dev environment is identical and is working perfectly. However, after performing the upgrade to Drupal 9 and CiviCRM 5.37.2  from Drupal 8 I am now getting a MySQL access denied error in production, only when accessing CiviCRM with Views.</p>
  <p>I have looked at this issue as an Amazon issue, a Drupal issue, and a CiviCRM issue.  I am not positive it is a CiviCRM issue but the tables are specifically CiviCRM so I am hoping I can get some help, please.</p>
  <p>This is the full error:</p>
  <pre><code>SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user 'user'@'10.0.2.97' for table 'civicrm_contact': SELECT &quot;civicrm_contact&quot;.&quot;id&quot; AS &quot;id&quot;, &quot;users_field_data_civicrm_uf_match&quot;.&quot;uid&quot; AS &quot;users_field_data_civicrm_uf_match_uid&quot;, &quot;contact_id_civicrm_contact&quot;.&quot;id&quot; AS &quot;contact_id_civicrm_contact_id&quot;, &quot;member_of_contact_id_civicrm_contact&quot;.&quot;id&quot; AS &quot;member_of_contact_id_civicrm_contact_id&quot; FROM {civicrm_contact} &quot;civicrm_contact&quot; INNER JOIN {civicrm_uf_match} &quot;civicrm_uf_match&quot; ON civicrm_contact.id = civicrm_uf_match.contact_id INNER JOIN {users_field_data} &quot;users_field_data_civicrm_uf_match&quot; ON civicrm_uf_match.uf_id = users_field_data_civicrm_uf_match.uid LEFT JOIN {civicrm_membership} &quot;contact_id_civicrm_contact&quot; ON civicrm_contact.id = contact_id_civicrm_contact.contact_id LEFT JOIN {civicrm_membership_type} &quot;member_of_contact_id_civicrm_contact&quot; ON civicrm_contact.id = member_of_contact_id_civicrm_contact.member_of_contact_id WHERE (users_field_data_civicrm_uf_match.uid = :users_field_data_uid) LIMIT 1 OFFSET 0; Array ( [:users_field_data_uid] =&gt; 3016 )
  </code></pre>
  <p>I have checked that when logging in directly to the database from the EC2 instance that I have access to the database and the specific table.  My EC2 security group has the appropriate grants for Amazon Aurora.</p>
  <p>I my settings.php has</p>
  <pre><code>$databases['default']['default']['prefix']= array(
    'default' =&gt; '',
    'civicrm_acl'                              =&gt; '`civicrm_prod`.', ...
  </code></pre>
  <p>I updated the array tonight after the upgrade.</p>
  <p>Any help is greatly appreciated.<br />
  Thanks,</p>
  <p>Josh</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-06-19T14:03:00.493Z
Comments.Text: Can you run `SHOW GRANTS FOR 'user'@'10.0.2.97'` in mysql?
Comments.UserDisplayName: Demerit
Tags: <drupal><upgrade><database><drupal-views>
Title: Drupal 9 View Shows Permission Denied For CiviCRM Tables
ThreadText: # Drupal 9 View Shows Permission Denied For CiviCRM Tables
  
  (Asked by: username_0 on 2021-06-19)
  
  I have my Drupal 9 database and my CiviCRM database in two separate databases on the same Amazon MySQL Aurora instance. The setup in our dev environment is identical and is working perfectly. However, after performing the upgrade to Drupal 9 and CiviCRM 5.37.2  from Drupal 8 I am now getting a MySQL access denied error in production, only when accessing CiviCRM with Views.
  I have looked at this issue as an Amazon issue, a Drupal issue, and a CiviCRM issue.  I am not positive it is a CiviCRM issue but the tables are specifically CiviCRM so I am hoping I can get some help, please.
  This is the full error:
  SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user 'user'@'10.0.2.97' for table 'civicrm_contact': SELECT "civicrm_contact"."id" AS "id", "users_field_data_civicrm_uf_match"."uid" AS "users_field_data_civicrm_uf_match_uid", "contact_id_civicrm_contact"."id" AS "contact_id_civicrm_contact_id", "member_of_contact_id_civicrm_contact"."id" AS "member_of_contact_id_civicrm_contact_id" FROM {civicrm_contact} "civicrm_contact" INNER JOIN {civicrm_uf_match} "civicrm_uf_match" ON civicrm_contact.id = civicrm_uf_match.contact_id INNER JOIN {users_field_data} "users_field_data_civicrm_uf_match" ON civicrm_uf_match.uf_id = users_field_data_civicrm_uf_match.uid LEFT JOIN {civicrm_membership} "contact_id_civicrm_contact" ON civicrm_contact.id = contact_id_civicrm_contact.contact_id LEFT JOIN {civicrm_membership_type} "member_of_contact_id_civicrm_contact" ON civicrm_contact.id = member_of_contact_id_civicrm_contact.member_of_contact_id WHERE (users_field_data_civicrm_uf_match.uid = :users_field_data_uid) LIMIT 1 OFFSET 0; Array ( [:users_field_data_uid] => 3016 )
  
  I have checked that when logging in directly to the database from the EC2 instance that I have access to the database and the specific table.  My EC2 security group has the appropriate grants for Amazon Aurora.
  I my settings.php has
  $databases['default']['default']['prefix']= array(
    'default' => '',
    'civicrm_acl'                              => '`civicrm_prod`.', ...
  
  I updated the array tonight after the upgrade.
  Any help is greatly appreciated.
  Thanks,
  username_0
  
  **Tags:** drupal, upgrade, database, drupal-views
  
  > **Comments:**
  > **username_1**: Can you run `SHOW GRANTS FOR 'user'@'10.0.2.97'` in mysql?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2021-06-21. Score: 2 | Accepted answer
  
  Remove ` symbol added to the database name in settings.php
  eg
  $databases['default']['default']['prefix']= array(
    'default' => '',
    'civicrm_acl'                              => '`civicrm_prod`.', ...
  
  change to
  $databases['default']['default']['prefix']= array(
    'default' => '',
    'civicrm_acl'                              => 'civicrm_prod.', ...
  
  > **Comments:**
  > **username_0**: Wow, thank you!.  I do not know how that happened, I just copied and pasted from the CiviCRM CMS page.  
  
  ---
  
  