标签:
于Mysql在有时会出现mysql.sock定位误差,会造成不连接数据库。
mac由当时的误差:
第一个变化my.cnf
位置/etc/my.cnf下一个,如果没有,那么。跟/usr/locate/mysql号/my.cnf下改动,然后拷贝到/etc下。
改动为例如以下:
[client] socket = /tmp/mysql.sock [mysqld] socket = /tmp/mysql.sock
然后重新启动mysql服务,打开mysql看看位置变了没~用,status查看
mysql Ver 14.14 Distrib 5.6.17, for osx10.7 (x86_64) using EditLine wrapper Connection id: 24 Current database: Current user: root@localhost SSL: Not in use Current pager: less Using outfile: '' Using delimiter: ; Server version: 5.6.17 MySQL Community Server (GPL) Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: utf8 Db characterset: utf8 Client characterset: utf8 Conn. characterset: utf8 UNIX socket: /tmp/mysql.sock Uptime: 15 min 51 sec
在:
pdo_mysql.default_socket=/tmp/mysql.sock mysql.default_socket = /tmp/mysql.sock mysqli.default_socket = /tmp/mysql.sock
然后
sudo apachectl stop sudo apachectl start
看phpinfo()下一个mysql.sock无论是改变~
版权声明:本文博主原创文章,博客,未经同意不得转载。
标签:
原文地址:http://www.cnblogs.com/hrhguanli/p/4817512.html