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 »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Drupal calendar displaying CiviEvents from separate DB
Pages: [1]

Author Topic: Drupal calendar displaying CiviEvents from separate DB  (Read 2800 times)

kvaughn

  • I’m new here
  • *
  • Posts: 4
  • Karma: 1
Drupal calendar displaying CiviEvents from separate DB
July 29, 2010, 07:26:16 am
I have read everything I can find on this issue and still can not get it working. I have a drupal site that uses a drupal database (drpl1_db) and a separate CiviCRM database (civi_db). Basic operations of the Drupal site and the CiviCRM work fine, but CiviCRM does not provide a built-in calendar view. So, I found the instructions to link with the Drupal calendar at http://wiki.civicrm.org/confluence/display/CRMDOC32/Using+Drupal+Calendar+with+CiviEvent. Luckily I already had the Drupal calendar (and views, et al) working with all the latest versions before working with the CiviEvent data.

However, after following all of the steps shown; I get the following error:
user warning: SELECT command denied to user 'user1'@'localhost' for table 'civicrm_event' ...

Before I had fixed some other problems, I was getting an error saying that the table could not be found; so I assume that it is now finding the right database, it just is not allowing my user account to login and access the data. I have already verified that the user has SELECT permissions and I am certain that the password is correct; I have even tried multiple accounts verifying that the rights are set and that the passwords are correct, but I always get the same error - just with the username changing.

My only clue as to what might be wrong is the cryptic statement in the above website that says: "Some hosting platforms might make this difficult." It is unclear if that is something related to merely setting SELECT permissions (which was easy) or if there is some special task that must be performed beyond that.

Looking through the various forum postings it seems like many people just give up and roll the CiviCRM database into the drupal database (despite this being exactly opposite to the configuration that CiviCRM documentation seems to recommend). I am hesitant to do this because I would like to use a shared CiviCRM database among multiple sites; in other words, I am working with several independent groups, each with their own Drupal website, that want to share their CiviCRM data with each other.  So ideally, I would have one CiviCRM database accessed by multiple Drupal databases. Any ideas?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Drupal calendar displaying CiviEvents from separate DB
July 29, 2010, 07:47:14 am
> Looking through the various forum postings it seems like many people just give up and roll the CiviCRM database into the drupal database (despite this being exactly opposite to the configuration that CiviCRM documentation seems to recommend).

You are correct, but except for backups and restores, using one database should NOT, in general, actually present any problems.

> I am hesitant to do this because I would like to use a shared CiviCRM database among multiple sites; in other words, I am working with several independent groups, each with their own Drupal website, that want to share their CiviCRM data with each other.  So ideally, I would have one CiviCRM database accessed by multiple Drupal databases. Any ideas?

This, however, may be problematic. CiviCRM links contacts to Drupal users, so if each site has unique users, then you may eventually find unexpected results...
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

kvaughn

  • I’m new here
  • *
  • Posts: 4
  • Karma: 1
Re: Drupal calendar displaying CiviEvents from separate DB
July 29, 2010, 11:38:08 am
Thanks for the warning; I did not fully recognize the impacts of that... I'll have to think more about how the multiple websites interact...

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Drupal calendar displaying CiviEvents from separate DB
July 29, 2010, 12:14:39 pm
The doc on using the drupal calendar w/ CiviEvents has a green "tip" at the top pointing you to the Views2 integration doc "if you have civicrm in a separate DB from drupal". Did you follow that link and do the setup required to get Views2 working in the separate DB mode? I suspect once Views2 if working, the calendar stuff will work too (altho haven't tried it myself).

With regard to multiple Drupal sites w/ one CiviCRM DB - there is support for this in the schema and codebase and some folks are using it. Eileen McNaughton has created some installation documentation for it at:

http://wiki.civicrm.org/confluence/display/CRMDOC32/Multi+Site+Installation

... note that the level of "complexity" can vary depending on whether you also need segmenting of the contacts by "site" and permissioning (i.e. some / all users for group A are not supposed to see contacts belonging to group B). Also, the organization which sponsored much of the development for multi-site functionality has decided to stop using it (they wound up deciding that their orgs really didn't need / want sharing at this level). So additional development in this area may be reduced.
Protect your investment in CiviCRM by  becoming a Member!

kvaughn

  • I’m new here
  • *
  • Posts: 4
  • Karma: 1
Re: Drupal calendar displaying CiviEvents from separate DB
July 29, 2010, 12:41:57 pm
Yep, I've followed the linkhttp://wiki.civicrm.org/confluence/display/CRMDOC32/Views2+Integration+Module in the 'green tip' at the top of the file:
- Added rows for an array of $db_url (just default and civicrm)
- Added the long array for $db_prefix
- And even followed the instructions at Redspire to add the 'database' => 'civicrm' lines in the civicrm.views.inc file

I also reset the views cache, tried disabling the view and re-enabling it... All sorts of stuff... I was able to see the change in the error from not finding the table in the Drupal database to now just saying that I do not have permission - so I figure the $db_prefix stuff must be working, but for some reason it is either:
- not recognizing my password (which I have checked countless times)
- not allowing the same user log into two databases simultaneously (I tried different accounts on the civicrm side; maybe I should change the drupal one?)
- not recognizing the permissions (but at least one of the accounts is the main one that I use to do everything else on the civi site)
- or ?????

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Drupal calendar displaying CiviEvents from separate DB
July 29, 2010, 12:56:15 pm
The only way I've done this is by having the same username / pw configured for access to both my Drupal and CiviCRM DB's. Not sure what's up in your situation. Maybe some other folks will chime in here?
Protect your investment in CiviCRM by  becoming a Member!

kvaughn

  • I’m new here
  • *
  • Posts: 4
  • Karma: 1
Re: Drupal calendar displaying CiviEvents from separate DB
July 29, 2010, 03:46:33 pm
Uhg! Stupid me! Computers are so anal!  :-[

My database has a 'feature' that prepends the default account user name to the front of each database name. I forgot to include this in my $db_prefix structure. Upon correcting each row to read "kvaughn_civicrm." rather than "civicrm." everything worked fine. 

An error code that indicated that it could not find the database would have been more useful than permissions being denied for a table; but I guess that is a security issue... At least I got it working. Thanks for all who provided help!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Drupal calendar displaying CiviEvents from separate DB

This forum was archived on 2017-11-26.