MySQL Error-Change mysql.sock location

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.