`
yl.fighter
  • 浏览: 253207 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

phpmyadmin 服务器没有响应(the local MySQL server's socket is not correctly configured)

阅读更多
转载自: http://hi.baidu.com/%D0%A1%C3%D7%B7%C9%C3%A8/blog/item/b26f73f05ff2e3baa50f52e6.html
出现该问题,多是socket 的配置问题,
一种可能是 mysql 的配置文件启用了 bind-address = 127.0.0.1 
可以去掉绑定,重启mysqld /etc/init.d/mysqld restart
或者把phpmyadmin 的config.inc.php 参数 $cfg['Servers'][$i]['host'] = 'localhost'; 由localhost 改为 127.0.0.1

第二种可能mysql server socket tmp 设置于php 配置文件设置不一样
写一文件phpinfo.php
内容如下:
<?phpinfo()?>
浏览里面的参数,找到mysql.sock在php配置的文件所在位置
在linux 中找到my.cnf
用locate my.cnf or find / -name my.cnf
vi 编辑my.cnf
只需修改:
# The MySQL server
[mysqld]
socket        = /tmp/mysql.sock
改为: socket        = /var/lib/mysql/mysql.sock  即你php要求的mysql.sock的地方

然后重启mysqld 
/etc/init.d/mysqld restart

my.cnf 配置文件 可研究里面参数,做服务器方面调整。
# The MySQL server
[mysqld]
port        = 3306
socket        = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
datadir = /data/www/mysql
pid-file=/var/log/mysql/mysql.pid
max_connections =1400
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics