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 »
  • Joomla! Installations (Moderator: Deepak Srivastava) »
  • Install yields only "DB Error: connect failed"
Pages: [1] 2

Author Topic: Install yields only "DB Error: connect failed"  (Read 7159 times)

nnangeroni

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
  • CiviCRM version: 3.4.0
  • CMS version: Drupal 6.20
  • MySQL version: 5.5.x
  • PHP version: 5.3.x
Install yields only "DB Error: connect failed"
November 01, 2009, 12:02:28 pm
When I try to install on my Joomla 1.5.14 system on a shared host server (ICDsoft), I get the following error:

Cannot open mysql://joomlaclient:xxxxxxxxxx@localhost:/tmp/mysql5.sock/masstpc_joomla?new_link=true: DB Error: connect failed

Could this be happening because I unzipped the tarball on my Mac then uploaded /com_civicrm to my server, rather than unzipping the files there (a functionality not readily available to me)?


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Install yields only "DB Error: connect failed"
November 01, 2009, 02:10:55 pm

thats a database connection error, not an install error. seems like your dsn settings are not valid

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

nnangeroni

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
  • CiviCRM version: 3.4.0
  • CMS version: Drupal 6.20
  • MySQL version: 5.5.x
  • PHP version: 5.3.x
Re: Install yields only "DB Error: connect failed"
November 01, 2009, 04:38:34 pm
Thanks, lobo, for the help.  Yes, the DSN setting line is:

define( 'CIVICRM_DSN'          , 'mysql://joomlaclient:xxxxxxxxx@localhost:/tmp/mysql5.sock/masstpc_joomla?new_link=true' );

It seems likely that MySQL is denying an access request, but it's not clear why, since Joomla is up and running using that database, with the same client ID and password.  Could it be a MySQL restriction on simultaneous logins to the same account?    


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Install yields only "DB Error: connect failed"
November 01, 2009, 07:11:36 pm

CiviCRM and Joomla use different libraries to connect to the DB

CiviCRM uses PEAR. I'm not sure if pear accepts the db format: /tmp/mysql5.sock/masstpc_joomla which seemss a bit strange to be the database name

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

nnangeroni

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
  • CiviCRM version: 3.4.0
  • CMS version: Drupal 6.20
  • MySQL version: 5.5.x
  • PHP version: 5.3.x
Re: Install yields only "DB Error: connect failed"
November 01, 2009, 07:24:08 pm
Thanks again.

masstpc_joomla is the database name; the preceding text is path.

From my host:

MySQL 5 Connection Settings:
Local (web applications): Host: localhost | Socket: /tmp/mysql5.sock
Note: Most PHP applications/scripts will accept the following syntax:
MySQL Host: localhost:/tmp/mysql5.sock


I'll try changing the localhost setting.  Um... I'm not sure where that value is controlled, since it was set at (attempted) installation.  Can you point me to the right place(s)?  Then do I run the installer from Joomla again?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Install yields only "DB Error: connect failed"
November 01, 2009, 07:42:48 pm

administrator/components/com_civicrm/civicrm.settings.php

for the PEAR DSN syntax check:

http://pear.php.net/manual/en/package.database.db.intro-dsn.php

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

nnangeroni

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
  • CiviCRM version: 3.4.0
  • CMS version: Drupal 6.20
  • MySQL version: 5.5.x
  • PHP version: 5.3.x
Re: Install yields only "DB Error: connect failed"
November 03, 2009, 01:04:58 pm
When I change the DSN values in civicrm.settings.php so that they read:

define( 'CIVICRM_UF_DSN', 'mysql://joomlaclient:xxxxxxxx@unix(localhost:/tmp/mysql5.sock)/masstpc_joomla?new_link=true' );
 
...which seems the right syntax for my host, they get overwritten to:

define( 'CIVICRM_UF_DSN' , 'mysql://joomlaclient:xxxxxxxx@localhost:/tmp/mysql5.sock/masstpc_joomla?new_link=true' );

... and I get the same error message with the same value (not the modified one that I wrote there).  Could this value be getting written there from somewhere else during the installation process?
« Last Edit: November 03, 2009, 01:06:51 pm by nnangeroni »

nnangeroni

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
  • CiviCRM version: 3.4.0
  • CMS version: Drupal 6.20
  • MySQL version: 5.5.x
  • PHP version: 5.3.x
Re: Install yields only "DB Error: connect failed"
November 03, 2009, 01:38:12 pm
In civicrm.settings.php.tpl, I find:

define( 'CIVICRM_DSN' , 'mysql://%%dbUser%%:%%dbPass%%@%%dbHost%%/%%dbName%%?new_link=true' );

I've tried modifying the syntax in this file, but the installer seems to ignore anything I do there.  I've made certain to uninstall civicrm, then make sure this line reads:

define( 'CIVICRM_DSN' , 'mysql://%%dbUser%%:%%dbPass%%@unix(%%dbHost%%)/%%dbName%%?new_link=true' );

...on the server, but I still get the error message:

Cannot open mysql://joomlaclient:xxxxxxxx@localhost:/tmp/mysql5.sock/masstpc_joomla?new_link=true: DB Error: connect failed

...which lacks my changed syntax.  So this file doesn't seem to be the controlling element.  

Help!
 
« Last Edit: November 03, 2009, 01:39:46 pm by nnangeroni »

nnangeroni

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
  • CiviCRM version: 3.4.0
  • CMS version: Drupal 6.20
  • MySQL version: 5.5.x
  • PHP version: 5.3.x
Re: Install yields only "DB Error: connect failed"
November 03, 2009, 02:34:53 pm
It's looking like the proper syntax is:

mysql://joomlaclient:xxxxxxxx@tcp(localhost:/tmp/mysql5.sock)/masstpc_joomla?new_link=true:

After a failed install, if I edit civicrm.settings.php with this value, then try running the CiviCRM component in the Joomla Admin, I get a "table doesn't exist" error (any other syntax returns "database connect failed).  So it looks like access to MySQL has been obtained - but not by the installer.  Checking MySQL directly, there are no CiviCRM tables installed in the Joomla database.  So, I now know the right syntax... but where does the installer obtain CIVICRM_DSN, if not from civicrm.settings.php.tpl?    
« Last Edit: November 03, 2009, 02:41:11 pm by nnangeroni »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Install yields only "DB Error: connect failed"
November 03, 2009, 07:38:10 pm

the joomla installer creates the DSN from the joomla settings and writes a new civicrm.settings.php. hence modifying an exisiting file will not work

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

nnangeroni

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
  • CiviCRM version: 3.4.0
  • CMS version: Drupal 6.20
  • MySQL version: 5.5.x
  • PHP version: 5.3.x
Re: Install yields only "DB Error: connect failed"
November 04, 2009, 10:51:37 am
Thanks, lobo, for your efforts here.

Yes, the DSN is created from the Joomla settings.  In civicrm.settings.php.tpl, this line:

define( 'CIVICRM_DSN' , 'mysql://%%dbUser%%:%%dbPass%%@%%dbHost%%/%%dbName%%?new_link=true' );

...when executed by a PHP processor, integrates the Joomla settings for username (%%dbuser%%), password (%%dbpass%%), hostname (%%dbhost%%) and database name (%%dbname%%) into a new string called "CIVICRM_DSN".  Clearly, this file provides a template for the creation of the DSN.

But, my modification of this string does not affect the installation process, which implies that some other mechanism is at play.  I can find NO other php code, in CiviCRM or Joomla, that assigns a value to CIVICRM_DSN.  

Any further help in ferreting out the source of the problem, and a solution, would be most welcome.  
 
« Last Edit: November 04, 2009, 11:41:34 am by nnangeroni »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Install yields only "DB Error: connect failed"
November 04, 2009, 12:48:58 pm

1. what specific civicrm package and file are you installing?

2. when and where do u make those changes?

if i had to guess, you will need to repackage the directory after u've made the changes.

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

nnangeroni

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
  • CiviCRM version: 3.4.0
  • CMS version: Drupal 6.20
  • MySQL version: 5.5.x
  • PHP version: 5.3.x
Re: Install yields only "DB Error: connect failed"
November 05, 2009, 07:08:47 am
I'm installing CiviCRM for Joomla, 3.0.2.

I'm making changes to joomla/tmp/com_civicrm/admin/civicrm/templates/CRM/common/civicrm.settings.php.tpl

Don't know what you mean by "repackage the directory".

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Install yields only "DB Error: connect failed"
November 05, 2009, 07:35:15 am

after you make the change what do you do next?

i assume u goto the installer and do an "install from directory"

can u let me know the filename you use for the above

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

nnangeroni

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
  • CiviCRM version: 3.4.0
  • CMS version: Drupal 6.20
  • MySQL version: 5.5.x
  • PHP version: 5.3.x
Re: Install yields only "DB Error: connect failed"
November 05, 2009, 08:22:41 am
That's right, I use the directory joomla/tmp/com_civicrm

Thank you!

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Joomla! Installations (Moderator: Deepak Srivastava) »
  • Install yields only "DB Error: connect failed"

This forum was archived on 2017-11-26.