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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Civix cannot connect to database.
Pages: [1]

Author Topic: Civix cannot connect to database.  (Read 1537 times)

Bioto

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.4.4
  • CMS version: Drupal Latest
  • MySQL version: Version in which i use
  • PHP version: 5.4
Civix cannot connect to database.
June 25, 2014, 01:40:02 pm
Hey everybody,

I am getting the following error when I try to setup civix.

Code: [Select]
<p>Initialization Error</p><p><pre>Array
(
    [callback] =&gt; Array
        (
            [0] =&gt; CRM_Core_Error
            [1] =&gt; simpleHandler
        )

    [code] =&gt; -24
    [message] =&gt; DB Error: connect failed
    [mode] =&gt; 16
    [debug_info] =&gt;  [nativecode=No such file or directory]
    [type] =&gt; DB_Error
    [user_info] =&gt;  [nativecode=No such file or directory]
    [to_string] =&gt; [db_error: message=&quot;DB Error: connect failed&quot; code=-24 mode=callback callback=CRM_Core_Error::simpleHandler prefix=&quot;&quot; info=&quot; [nativecode=No such file or directory]&quot;]
)

If I change the host name from "localhost" to "127.0.0.1" i get:

Code: [Select]
<p>Initialization Error</p><p><pre>Array
(
    [callback] =&gt; Array
        (
            [0] =&gt; CRM_Core_Error
            [1] =&gt; simpleHandler
        )

    [code] =&gt; -24
    [message] =&gt; DB Error: connect failed
    [mode] =&gt; 16
    [debug_info] =&gt;  [nativecode=Connection refused]
    [type] =&gt; DB_Error
    [user_info] =&gt;  [nativecode=Connection refused]
    [to_string] =&gt; [db_error: message=&quot;DB Error: connect failed&quot; code=-24 mode=callback callback=CRM_Core_Error::simpleHandler prefix=&quot;&quot; info=&quot; [nativecode=Connection refused]&quot;]
)
</pre></p><p></p>


Even though I am getting these errors, my install of civi and drupal are working perfectly fine.

Any help would be much appreciated!

System: Fresh install Mac Mountain Lion
Drupal: 7.28
Civi: 4.4.5

Stack: MAMP

Thanks!

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: Civix cannot connect to database.
June 25, 2014, 03:48:44 pm
a) The command-line is probably configured to use OS X's built-in PHP instead of MAMP's PHP. MAMP's PHP has some patches that help it connect to MAMP's MySQL. See https://wiki.civicrm.org/confluence/display/CRMDOC/Setup+Command-Line+PHP

b) You might try specifying MySQL's TCP port as part of the URL in civicrm.settings.php. In MAMP, this is probably 8889, but you can consult to the MAMP config screens to see what the correct value is.

Bioto

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.4.4
  • CMS version: Drupal Latest
  • MySQL version: Version in which i use
  • PHP version: 5.4
Re: Civix cannot connect to database.
June 25, 2014, 04:39:34 pm
Changing the port worked :P Thank you!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Civix cannot connect to database.

This forum was archived on 2017-11-26.