当mysql使用unix socket启动时,直接使用localhost会发生了一个数据库错误,发生无法连接数据库错误。
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';
(...)
read the rest of php 连接 unix_socket mysql (47 words)
© li xi for lixiphp, 2014. |permalink |no comment |add todel.icio.us
post tags: ci, drupal, mysql, unix_socket
feed enhanced by better feed from ozh