I have a MySQL error when I access www.gote-biz.com on host company DreamHost.com.

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/.gomorrah/morganmac/gote-biz.com/includes/database.mysql.inc on line 31
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

From my search of the forums I can tell this is related to MySQL and not Drupal itself. Unfortunately, I am new to Drupal, PHP and MySQL so trouble shooting this has been a challenge. Can anyone point me in a possible direction. I have sent this error to Dreamhost (referred several times in the Hosting forum) so they can provide some insite. If anyone has any input it would be much appreciated.

Thanks,
mormac

PS: once I get Drupal working I plan on using it for:
www.gote-biz.com
www.rateyourcertification.com
www.productsthatpissusoff.com

Look for them soon . . . .I hope :-)

Comments

johnhanley’s picture

mormac,

Unless you have root access to the server the only thing you can do is open a trouble ticket and wait for your web host to resolve the problem.

John

Mormac’s picture

Thanks for the fast reply John. The sites are hosted by Dreamhost and a ticket has been submitted.

I will see what happens and post the info in the forums.

Thanks,
mormac

rup3rt’s picture

Dreamhost are doing all they can to avoid fixing this issue. More news after I open my THIRD TICKET.....

rup3rt’s picture

Lucky I didn't. I had to toggle modules in the database (The system table using phypmyadmin) because I couldn't login.

I switched off Gallery2 and it was OK. It is always a cross-authentication thing. I will check my settings in Gallery (which also does cross-logins)

It also shows up with login toboggan http://drupal.org/comment/reply/27070/133852

So check all areas where there is user authentication or cross authentication

enkay’s picture

This has probably been resolved by now, still,

I had this problem recently with Drupal 6.10 (and freehostia), turns out all I had to do was to expand "Advanced Options" on the Drupal setup page, and specify the database server and port manually. This can also happen if the database is on a different server, I think by default drupal tries "localhost".

Hope this helped someone.

applerochez’s picture

hi all,
i've run into this problem a few times.

in your drupal folder (already on your server) update your /sites/default/settings.php file where
$db_url = 'pgsql://username:password@localhost/databasename';
change to:
$db_url = 'pgsql://username:password@example.com/databasename';

hope this helps!

prolific_one’s picture

For me it's within the handlers.inc file for the views module... I have tried the dev version and the previous release and all 3 give this error on my login screen.

warning: mysql_get_server_info() [function.mysql-get-server-info]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in ..html/sites/all/modules/views/includes/handlers.inc on line 957.
warning: mysql_get_server_info() [function.mysql-get-server-info]: A link to the server could not be established in .../html/sites/all/modules/views/includes/handlers.inc on line 957.

line 957 is the elseif line below (of this views/includes/handler.inc). I am using a godaddy msql (not msqli) db.

function views_get_timezone() {
  global $user;
  if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) {
    $timezone = $user->timezone;
  }
  else {
    $timezone = variable_get('date_default_timezone', 0);
  }

  // set up the database timezone
  if (in_array($GLOBALS['db_type'], array('mysql', 'mysqli', 'pgsql'))) {
    $offset = '+00:00';
    static $already_set = false;
    if (!$already_set) {
      if ($GLOBALS['db_type'] == 'pgsql') {
        db_query("SET TIME ZONE INTERVAL '$offset' HOUR TO MINUTE");
      }
      elseif ($GLOBALS['db_type'] == 'mysqli' || version_compare(mysql_get_server_info(), '4.1.3', '>=')) {
        db_query("SET @@session.time_zone = '$offset'");
      }

      $already_set = true;
    }
  }

  return $timezone;
}