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 »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Anyone care to share their multi database array from settings.php?
Pages: [1]

Author Topic: Anyone care to share their multi database array from settings.php?  (Read 2677 times)

Dorothys Ride

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • CiviCRM version: 4.1.0
  • CMS version: Drupal 7.12
  • MySQL version: 5.0
  • PHP version: 5.3.6
Anyone care to share their multi database array from settings.php?
February 18, 2012, 06:41:51 pm
 I've been trying to get cvevents working to no avail. One of my many issues appears to be that I have my database array in  settings.php set up incorrectly. I am hoping that resolving this will resolve the other issues.

Thanks
« Last Edit: February 18, 2012, 07:09:48 pm by Dorothys Ride »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Anyone care to share their multi database array from settings.php?
February 19, 2012, 04:49:34 am
Can you post your settings.php (change the password if you want) so we can see it and help you? Note that you must add the code from CiviCRM after the existing $database definition in that file.
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.

Dorothys Ride

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • CiviCRM version: 4.1.0
  • CMS version: Drupal 7.12
  • MySQL version: 5.0
  • PHP version: 5.3.6
Re: Anyone care to share their multi database array from settings.php?
February 19, 2012, 06:20:06 am
 Hi Hershel,

 Thanks. I've read a few pages in regards to the settings.php file but it is not one of my strong points. I rely heavily on the php and mysql websites and PHP and MySQL® Web Development 4th edition.

Code: [Select]
$databases = array (
  'default' =>   
   'other_database' => array // I've added and removed this

  array (
    'default' =>
    'other_database' => array // I've added and removed this
    array (
      'database' => 'mydrupaldb',
      'username' => 'mydrupaldbun',
      'password' => 'mydrupaldbpsswrd',
      'host' => 'localhost',
      'port' => ' ',
      'driver' => 'mysql',
      'prefix' => '',
     

    ),

 $other_database = array(
      'database' => 'mycvcrmdb',
      'username' => 'mycvcrmdbun', // assuming this is necessary
      'password' => 'mycvcrmdbpsswrd', // assuming this is necessary
      'host' => 'localhost', // assumes localhost
      'driver' => 'mysql', // replace with your database driver
  ); // I've removed and replaced the sc
   
// I've moved this in and out of the closing parenthesis and tried a few different dbkeys using the name of a custom field from the cvcrm db.

  // replace 'YourDatabaseKey' with something that's unique to your module
  Database::addConnectionInfo('YourDatabaseKey', 'default', $other_database);
  db_set_active('YourDatabaseKey');

  // execute queries here

  db_set_active(); // without the paramater means set back to the default for the site
  drupal_set_message(t('The queries have been made.'));
   
  ),
);

 Sometimes it breaks everything sometimes things still work but retain the error messages.

Thanks again

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Anyone care to share their multi database array from settings.php?
February 19, 2012, 06:50:21 am
Can you explain what you're trying to do and why you think you need all this? What is this "cvevents" that you want to use?
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.

Dorothys Ride

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • CiviCRM version: 4.1.0
  • CMS version: Drupal 7.12
  • MySQL version: 5.0
  • PHP version: 5.3.6
Re: Anyone care to share their multi database array from settings.php?
February 19, 2012, 09:28:33 am
I stumbled on Drupal and CivicCRM while trying to achieve a very limited portion of this organizations objectives with osCommerce. Someone from their forums pointed me in this direction. I was resisting but the more I looked at what this organizations goals were it made no sense to continue on that route. While I was "volunteered" to do this they had already wasted a boat load of money on a 7 page website that does absolutely nothing they were looking for in the first place.

Well... when I went through the "is civicrm right for you"  and read the planning docs, it recommended that for easier updates of either component, drupal or cvcrm, maintaining separate dbs would help facilitate that. That is the way I understood it anyway.

cvevents = CivicEvent

 They organize a number of events, large and small, as well as help others organize their events. They are trying to make it easier to organize and keep everyone on the same page. If they are working with five similar events, say diabetes screenings at five different venues they end up dealing with five different types of events so everyone is off in different directions and no one knows what anyone else is talking about, doing etc. i.e. if one screening is at a library, another is at a mall and another is at a?? they become a library event, a mall event and a ?? event. They don't know what a library event is. Those are just venues. They know screenings, organ donor conferences/registrations, vehicle rallies, tours and parades etc., etc.. Each one requires different groups of people to organize and are geared towards different demographics as well.

 So long story short everyone is trying to put together a "system" composed of primarily platform specific tools that aren't really capable of doing what they are trying to achieve in the first place and I see Drupal and CivicCRM as a solution to many of their challenges.

 Thanks again.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Anyone care to share their multi database array from settings.php?
February 19, 2012, 02:41:16 pm
To use CiviEvent features you do not need to edit settings.php at all. You just need to install CiviCRM as per the installation instructions in the wiki. That's it.

The only reason you would have to edit settings.php would be to achieve Views Integration and that is optional and you don't need it unless you have a specific reason for needing it.
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.

Dorothys Ride

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • CiviCRM version: 4.1.0
  • CMS version: Drupal 7.12
  • MySQL version: 5.0
  • PHP version: 5.3.6
Re: Anyone care to share their multi database array from settings.php?
February 19, 2012, 06:25:04 pm
 Well it sounded easy enough but I guess that is what I am trying to do. Integrate a view. Sorry I have only known about cvcrm for a little more than a few days and have yet to come across a glossary to be able to speak the language. I want to put the CiviEvents calender(?) in a view. Can you provide a link to the wiki? I understand the prohibition of links and therefore the lack of the http but I think I can figure that part out at least if you could direct me to the rest. However, I think I may have been following the wiki instructions.

Thanks so much for your help.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Anyone care to share their multi database array from settings.php?
February 20, 2012, 03:15:23 am
Put your settings.php back as it was and follow this step by step for Views Integration:

http://wiki.civicrm.org/confluence/display/CRMDOC40/Views3+Integration

I presume you have CiviCRM installed already, but if not, this is the install manual:

http://wiki.civicrm.org/confluence/display/CRMDOC41/Drupal+Installation+Guide+for+CiviCRM+4.1+-+Drupal+7
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.

Dorothys Ride

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • CiviCRM version: 4.1.0
  • CMS version: Drupal 7.12
  • MySQL version: 5.0
  • PHP version: 5.3.6
Re: Anyone care to share their multi database array from settings.php?
February 21, 2012, 07:17:16 am
Hi Hershel,

 Yes I was following the step by step in the wiki and nothing is working as it seems its supposed to. I am using Drupal 7.12 CiviCRM 4.1 and installed  views-7.x-3.1. I used the installers for all but just as was the case wth the CiviCRM installer the path to access the CivCRM admin is different than what is indicated everywhere I look.

This //yourdomain.com/civicrm/admin/setting/uf?reset=1 gives me a dead end page not found and when I change the path to what the path appears to be on the server I get the same thing.

 Currently having an issue with the hosting company granting the SELECT permissions to the db and although I was able to do that on my local installation I still could not figure out the proper way to write the array script.

 Thanks

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Anyone care to share their multi database array from settings.php?
February 21, 2012, 08:53:36 am
yourdomain.com/civicrm/admin/setting/uf?reset=1 will work if your CiviCRM home page is yourdomain.com/civicrm

What is your CiviCRM home page ?
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.

Dorothys Ride

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • CiviCRM version: 4.1.0
  • CMS version: Drupal 7.12
  • MySQL version: 5.0
  • PHP version: 5.3.6
Re: Anyone care to share their multi database array from settings.php?
February 21, 2012, 11:33:08 am
Thanks Hershel,

If we are talking about the same thing"forum" is the home page but mydomain/forum/admin/settings... hasn't worked nor has writing out the entire path or any variations thereof. .../forum/sites/all/modules/civicrm/CRM/admin/form/setting/UF?reset=1

 When I just go directly to the file and open it up it it appears that it believes there is a single database and that it is looking for database prefixes and not separate databases and or users. A sample on the wiki page would have helped me to understand it a bit better.

Code: [Select]
'$databases[\'default\'][\'default\'][\'prefix\']= array(';
            foreach ( $tableNames as $tableName => $value ) {
                $tablePrefixes .= "\n  '" . str_pad($tableName . "'", 41) . " => '`{$dsnArray['database']}`.',";
            }
            $tablePrefixes .= "\n);";
            $this->assign('tablePrefixes', $tablePrefixes);

 It may just end up being moot at this point anyway as it doesn't appear that the hosting co supports anything other than using a single database as the database and user names are the same (i.e. drupaldb is the database name and the user name) and cannot be used as a "read only" user for the CiviCRM database and vise-versa so therefore I can't meet the requirement that "the same database user has access to both the CiviCRM and Drupal databases".

 Thanks again.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Anyone care to share their multi database array from settings.php?
February 21, 2012, 11:37:48 am
You don't need two databases for CiviCRM. Some people even prefer to use one--anyhow one works just fine.

If your Drupal is installed in somedomain.com then your CiviCRM home page is somedomain.com/civicrm If that page fails, then CiviCRM is not installed correctly.
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.

Dorothys Ride

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • CiviCRM version: 4.1.0
  • CMS version: Drupal 7.12
  • MySQL version: 5.0
  • PHP version: 5.3.6
Re: Anyone care to share their multi database array from settings.php?
February 21, 2012, 04:05:08 pm
Are you saying that CiviCRM should be installed at the root alongside the Drupal directory and not in it?

Well it looks like I'll be installing it again then...

 Does the installation leave the necessary files in place or are they altered or deleted upon install? If I just delete the databases and the settings file will it reinstall properly or do I wipe the whole thing yet again?

 I have followed the instructions to a t and let the installer do what it wants to do with the exception of giving Drupal a new name and placing it at the root when it asked. The original  one click Drupal installation (which I have since deleted) done by the hosting company put it in an additional folder. Otherwise I haven't changed directories or anything else like that. CivicCRM has had issues when installed both locally and on the remote server and I have had to actually force it to open the installer. Should I just do the one-click installation of 7.10 and start from there?

Thanks again

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Anyone care to share their multi database array from settings.php?
February 22, 2012, 03:08:59 am
Quote from: Dorothys Ride on February 21, 2012, 04:05:08 pm
Are you saying that CiviCRM should be installed at the root alongside the Drupal directory and not in it?

No, I said no such thing.

I have no idea what you have now, but what you should do is:

1. Install fresh Drupal
2. Follow the CiviCRM installation instructions. It tells you there precisely where to put the files.

What I said is that once all that is done, the string /civicrm appended to your Drupal root URL (whatever it might be) will be your CiviCRM home page.

So if your Drupal URL is civicrm.org then your CiviCRM (after it's installed) will be civicrm.org/civicrm
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.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Anyone care to share their multi database array from settings.php?

This forum was archived on 2017-11-26.