Can T connect to the local MySQL server through Socket/var/lib/mysql/mysql.sock

Source: Internet
Author: User
Tags set time

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

Reference to a foreign website is a matter of privilege


Avenson & Root Privs to database Gallery2:

Grants for Root@localhost |

The code is as follows Copy Code
+-------------------------------------------------------------------------------------------------------------- --------------------------+
| GRANT all Privileges "*.* to ' root" @ ' localhost ' identified by PASSWORD ' *8C4AC955DD6333EF4FB4F569301A21D9539567A1 ' with GRANT OPTION |
| GRANT all privileges in ' Gallery2 '. * to ' root ' @ ' localhost '

Grants for Avenson@localhost |
+-------------------------------------------------------------------------------------------------------------- --+

The code is as follows Copy Code
| GRANT USAGE on *.* to ' avenson ' @ ' localhost ' identified by PASSWORD ' *8C4AC955DD6333EF4FB4F569301A21D9539567A1 ' |
| GRANT all privileges in ' Gallery2 '. * to ' avenson ' @ ' localhost '


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


The code is as follows Copy Code

Function Views_get_timezone () {
  global $user;
  if (variable_get (' Configurable_timezones ', 1) & amp;& $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;
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.