錯誤連接
Warning: mysql_connect() [function.mysql-connect]: [2002]
這時應當修改hostname,例如在CI 配置數據庫 (database.php) 從:
$db['default']['hostname'] = 'localhost'; 到:
$db['default']['hostname'] = 'localhost:/Applications/mamp/mysql/tmp/mysql.sock';
Drupal 中配置連接 unix_socket MYSQL
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'drupal7',
'username' => 'root',
'password' => '123456',
'host' => 'localhost',
'port' => '3306',
'unix_socket' => '/Applications/mamp/mysql/tmp/mysql.sock',
'driver' => 'mysql',
'prefix' => '',
),
),
);
接下來應該由你自己去嘗試配置PHP 連接 unix_socket MySQL。