Answers.Body: <p>For me and a few other users, with Civi &amp; Drupal in separate databases, this was solved by comment #4 on <a href="https://www.drupal.org/project/civicrm_entity/issues/3198146" rel="nofollow noreferrer">Views integration error on D9</a>:</p>
  <blockquote>
  <p>Try removing the back ticks ... '`' from the prefix information in the settings.local.php</p>
  </blockquote>
  <p>(or settings.php in my case.)</p>
  <p>If it's not working for you with Civi &amp; Drupal in the same database, assuming you've removed the code that you pasted into the settings file, maybe try Jon G's solution at <a href="https://civicrm.stackexchange.com/questions/27768/how-to-get-civicrm-views-to-work-in-drupal-8-with-separate-civicrm-database">How to get CiviCRM Views to work in Drupal 8 with separate CiviCRM database</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-21T17:42:51.837Z
Answers.LastActivityDate: 2021-04-21T17:42:51.837Z
Answers.UserDisplayName: davejenx
Body: <p>I'm having an almost identical problem to this person (<a href="https://www.drupal.org/project/civicrm_entity/issues/3198146" rel="nofollow noreferrer">https://www.drupal.org/project/civicrm_entity/issues/3198146</a>) so I'm hoping to get an answer for both of us.</p>
  <p><a href="https://civicrm.stackexchange.com/questions/38807/how-to-get-views-to-work-in-civicrm-on-drupal9-with-separate-civicrm-database">It looks like this may also be the same issue.</a></p>
  <p>I have a Drupal 9/CiviCRM install set up on a shared hosting account on A2Hosting. Everything has gone smoothly so far, and I was able to follow the Views integration instructions exactly.  However, when I try to set up a simple View to test, I get the following error:</p>
  <pre><code>SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user '&lt;USER&gt;'@'localhost' for table 'civicrm_contact': SELECT &quot;civicrm_contact&quot;.&quot;id&quot; AS &quot;id&quot; FROM {civicrm_contact} &quot;civicrm_contact&quot; LIMIT 11 OFFSET 0; Array ( )
  </code></pre>
  <p>The error seems pretty self-explanatory - I need to assign SELECT privileges to the  in question - but I've tried everything I can think of, namely:</p>
  <ol>
  <li><p>I've given the USER in question ALL PRIVILEGES on the CiviCRM database in cPanel. I can't access the User list via phpMyAdmin, which I guess is common on shared hosting.</p>
  </li>
  <li><p>I've tried to use the command line to check the status of the USER's privileges, but I apparently need root access, which is not possible on the shared hosting plan.</p>
  </li>
  <li><p>I've contacted A2Hosting directly to see if they can help check (or correctly assign) the
  privileges for the USER in question. They say they can't.</p>
  </li>
  </ol>
  <p>So, I have a few questions that I'd love help answering (I'm a relative beginner at all of this):</p>
  <ul>
  <li><p>Is this a known issue? There are at least two of us now who've been stumped by it. Is there a quick fix I'm not seeing?</p>
  </li>
  <li><p>Are the USER in cPanel and USER@localhost different entities? Is it possible that they would have different privileges?</p>
  </li>
  <li><p>If Views integration is somehow not possible in a shared hosting environment, what is the preferred set up?  Am I on the wrong hosting service?</p>
  </li>
  </ul>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-03-05T17:48:40.293Z
Comments.Text: UPDATE:  I Gave Up
  
  After much scouring of forums and contacting of people, the best I could come up with is that it "should work."  So I gave up and have just reinstalled with CiviCRM on a shared db with Drupal.
  
  However!  While I no longer have a privileges issue, Views doesn't seem to know that CiviCRM is there.  
  
  The documentation seems to say that it should just work out of the box:
  
  "If your CiviCRM and Drupal are located within the same database the 12 steps below are not required."
  
  What am I doing wrong now?
Comments.UserDisplayName: Austin Zumbro
Tags: <drupal-views><mysql><integration><drupal-9>
Title: Troubleshooting SELECT Privileges Issue with Drupal 9 Views Integration
ThreadText: # Troubleshooting SELECT Privileges Issue with Drupal 9 Views Integration
  
  (Asked by: username_0 on 2021-03-02)
  
  I'm having an almost identical problem to this person (https://www.drupal.org/project/civicrm_entity/issues/3198146) so I'm hoping to get an answer for both of us.
  It looks like this may also be the same issue.
  I have a Drupal 9/CiviCRM install set up on a shared hosting account on A2Hosting. Everything has gone smoothly so far, and I was able to follow the Views integration instructions exactly.  However, when I try to set up a simple View to test, I get the following error:
  SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user ''@'localhost' for table 'civicrm_contact': SELECT "civicrm_contact"."id" AS "id" FROM {civicrm_contact} "civicrm_contact" LIMIT 11 OFFSET 0; Array ( )
  
  The error seems pretty self-explanatory - I need to assign SELECT privileges to the  in question - but I've tried everything I can think of, namely:
  
  I've given the USER in question ALL PRIVILEGES on the CiviCRM database in cPanel. I can't access the User list via phpMyAdmin, which I guess is common on shared hosting.
  
  I've tried to use the command line to check the status of the USER's privileges, but I apparently need root access, which is not possible on the shared hosting plan.
  
  I've contacted A2Hosting directly to see if they can help check (or correctly assign) the
  privileges for the USER in question. They say they can't.
  
  
  So, I have a few questions that I'd love help answering (I'm a relative beginner at all of this):
  
  Is this a known issue? There are at least two of us now who've been stumped by it. Is there a quick fix I'm not seeing?
  
  Are the USER in cPanel and USER@localhost different entities? Is it possible that they would have different privileges?
  
  If Views integration is somehow not possible in a shared hosting environment, what is the preferred set up?  Am I on the wrong hosting service?
  
  **Tags:** drupal-views, mysql, integration, drupal-9
  
  > **Comments:**
  > **username_0**: UPDATE:  I Gave Up  After much scouring of forums and contacting of people, the best I could come up with is that it "should work."  So I gave up and have just reinstalled with CiviCRM on a shared db with Drupal.  However!  While I no longer have a privileges issue, Views doesn't seem to know that CiviCRM is there.    The documentation seems to say that it should just work out of the box:  "If your CiviCRM and Drupal are located within the same database the 12 steps below are not required."  What am I doing wrong now?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-04-21. Score: 0
  
  For me and a few other users, with Civi & Drupal in separate databases, this was solved by comment #4 on [Views integration error on D9](https://www.drupal.org/project/civicrm_entity/issues/3198146):
  
  > Try removing the back ticks ... '`' from the prefix information in the settings.local.php
  
  (or settings.php in my case.)
  
  If it's not working for you with Civi & Drupal in the same database, assuming you've removed the code that you pasted into the settings file, maybe try Jon G's solution at [How to get CiviCRM Views to work in Drupal 8 with separate CiviCRM database](https://civicrm.stackexchange.com/questions/27768/how-to-get-civicrm-views-to-work-in-drupal-8-with-separate-civicrm-database).
  
  
  ---
  
  