|
安装了OpenBSD 3.6,通过pkg_add安装了mysql,PHP
用mysqld_safe & 启动正常,产生了/var/run/mysql/mysql.sock文件,且对数据库简单操作正常,总之mysql起来了。
但是在php脚本调用mysql时总是提示出现
#2002 - Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
---------------------------------------------------
my.cnf相关配置为
[client]
#password = your_password
port = 3306
socket =
host = localhost
[mysqld]
port = 3306
socket = /var/run/mysql/mysql.sock
skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
net_buffer_length = 2K
thread_stack = 64K
[mysqld_safe]
port = 3306
socket = /var/run/mysql/mysql.sock
skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
net_buffer_length = 2K
thread_stack = 64K
open-files = 1000
----------------------------------------------------
php.ini相关配置为
[MySQL]
mysql.allow_persistent = On
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port = 3306
mysql.default_socket = /var/run/mysql/mysql.sock
mysql.default_host = localhost
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
extension=mysql.so
------------------------------------------------------
试过以下方法:
1、关闭httpd的chroot,结果无效
2、更改php.ini中的"mysql_connect="从"localhost"为本机的全域名,无效
3、更改/var/run/mysql目录以及/var/run/mysql/mysql.sock文件属性为777,无效
已经折腾了几天了,现在是山穷水尽,只好请各位高手指点一二
另:mysql.sock文件随mysql启动而产生,随着它的停止而消失,但是长度好像始终为0,有没有什么问题? |
|