In MySQL sometimes the Mysql.sock location error occurs, which causes the database to be disconnected.
Mac by the time error:
The first change of MY.CNF
Position/etc/my.cnf Next, if not, then. Change with/usr/locate/mysql/my.cnf and copy to/etc.
Change to such as the following:
[Client]socket =/tmp/mysql.sock[mysqld]socket =/tmp/mysql.sock
Without [client] words. Join yourself ~
Then restart the MySQL service, open MySQL to see if the location has changed ~ use, Status View
MySQL Ver 14.14 distrib 5.6.17, for osx10.7 (x86_64) using editline wrapperconnection id:24current Database: Current User:[email protected]ssl:not in usecurrent pager:lessusing outfile: ' Using delimiter:; Server version:5.6.17 MySQL Community Server (GPL) Protocol version:10connection:localhost via UNIX socketserver characterset:utf8db characterset:utf8client characterset:utf8conn. Characterset:utf8unix socket:/tmp/mysql.sockuptime:15 min sec
Then change the php.ini (position is/etc/php.ini) no words. Copy a Php.ini.default
In:
Pdo_mysql.default_socket=/tmp/mysql.sockmysql.default_socket =/tmp/mysql.sockmysqli.default_socket =/tmp/ Mysql.sock
All three of these changes are good ~
And then
sudo apachectl stopsudo apachectl start
will be able to ~
See Phpinfo () Next Mysql.sock whether it's changing ~
Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.
MySQL Error-Change mysql.sock location