CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • views returns error: SELECT command denied (drupal)
Pages: [1]

Author Topic: views returns error: SELECT command denied (drupal)  (Read 1191 times)

Danny_Joris

  • Guest
views returns error: SELECT command denied (drupal)
September 20, 2010, 07:26:18 am
Hello,

I had set up a drupal view, where contacts from CiviCRM are listed. This worked fine when I only had one test contact (individual). Later I imported 600+ contacts in the database and to what I can tell this worked out great.

But now my view returns this error: http://dannyjoris.be/files/fora/civicrm_views-error.png
In the views edit I tried to reduce the fields to just the name or ID, but it still returned an error.

This is the error with only the contact ID as the field:
Quote
   * user warning: SELECT command denied to user 'kbvr'@'localhost' for table 'civicrm_contact' query: SELECT COUNT(*) FROM (SELECT civicrm_contact.id AS id FROM kbvrcivicrm.civicrm_contact civicrm_contact LEFT JOIN kbvrcivicrm.civicrm_membership civicrm_membership ON civicrm_contact.id = civicrm_membership.contact_id WHERE (civicrm_contact.contact_type in ('Individual')) AND (civicrm_membership.membership_type_id in ('1')) AND (civicrm_membership.status_id in ('1', '2', '3')) ) count_alias in /var/www/vhosts/dotprojects.be/subdomains/kbvr/httpdocs/sites/all/modules/views/includes/view.inc on line 745.
    * user warning: SELECT command denied to user 'kbvr'@'localhost' for table 'civicrm_contact' query: SELECT civicrm_contact.id AS id, RAND() AS _random FROM kbvrcivicrm.civicrm_contact civicrm_contact LEFT JOIN kbvrcivicrm.civicrm_membership civicrm_membership ON civicrm_contact.id = civicrm_membership.contact_id WHERE (civicrm_contact.contact_type in ('Individual')) AND (civicrm_membership.membership_type_id in ('1')) AND (civicrm_membership.status_id in ('1', '2', '3')) ORDER BY _random ASC LIMIT 0, 20 in /var/www/vhosts/dotprojects.be/subdomains/kbvr/httpdocs/sites/all/modules/views/includes/view.inc on line 771.

Any ideas to debug this?

Danny_Joris

  • Guest
Re: views returns error: SELECT command denied (drupal)
September 20, 2010, 07:37:41 am
Stripped down, with only one field (contact ID) and no filters or sort criteria:
Quote

    * user warning: SELECT command denied to user 'kbvr'@'localhost' for table 'civicrm_contact' query: SELECT COUNT(*) FROM (SELECT civicrm_contact.id AS id FROM kbvrcivicrm.civicrm_contact civicrm_contact ) count_alias in /var/www/vhosts/dotprojects.be/subdomains/kbvr/httpdocs/sites/all/modules/views/includes/view.inc on line 745.
    * user warning: SELECT command denied to user 'kbvr'@'localhost' for table 'civicrm_contact' query: SELECT civicrm_contact.id AS id FROM kbvrcivicrm.civicrm_contact civicrm_contact LIMIT 0, 20 in /var/www/vhosts/dotprojects.be/subdomains/kbvr/httpdocs/sites/all/modules/views/includes/view.inc on line 771.


Danny_Joris

  • Guest
Re: views returns error: SELECT command denied (drupal)
September 20, 2010, 07:51:50 am
dlobo pointed out on irc that the DB user of my drupal install needs select (and maybe other) permission on both databases.

See point one of http://wiki.civicrm.org/confluence/display/CRMDOC32/Views2+Integration+Module

I'll try this and I'll update this post.

Danny_Joris

  • Guest
Re: views returns error: SELECT command denied (drupal)
September 20, 2010, 08:34:49 am
Great, this worked!

Additionally I also had to update the CiviCRM prefixes that can be found at civicrm/admin/setting/uf?reset=1

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • views returns error: SELECT command denied (drupal)

This forum was archived on 2017-11-26.