鸿 网 互 联 www.68idc.cn

Can t connect to local MySQL server through socket /var/lib/

来源:互联网 作者:佚名 时间:2013-04-20 14:01
Warning: mysql_connect() [function.mysql-connect]: Can\'t connect to local MySQL server through socket \'/var/lib/mysql/mysql.sock\' (2)

Warning: _connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/63/8523763/html/deng/fqlbnet/admin/inc/db. on line 34
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

参考一个国外网站是权限问题


avenson & Root privs to database gallery2:

Grants for root@localhost |

 代码如下 复制代码
+----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*8C4AC955DD6333EF4FB4F569301A21D9539567A1' WITH GRANT OPTION |
| GRANT ALL PRIVILEGES ON `gallery2`.* TO 'root'@'localhost'

Grants for avenson@localhost |
+----------------------------------------------------------------------------------------------------------------+

 代码如下 复制代码
| GRANT USAGE ON *.* TO 'avenson'@'localhost' IDENTIFIED BY PASSWORD '*8C4AC955DD6333EF4FB4F569301A21D9539567A1' |
| GRANT ALL PRIVILEGES ON `gallery2`.* TO 'avenson'@'localhost'


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;
}

网友评论
<