MySQL Error-Modify Mysql.sock location

Source: Internet
Author: User

There are sometimes mysql.sock location errors under MySQL, which prevents the database from being linked.

Mac error When:


First modify the MY.CNF

Location under/ETC/MY.CNF, if not, go to/usr/locate/mysql version/my.cnf under Change, and then copy to/etc.

The changes are as follows:

[Client]socket =/tmp/mysql.sock[mysqld]socket =/tmp/mysql.sock

If there is no [client], add it yourself ~


Then restart the MySQL service, open MySQL to see if the location has changed to 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 modify php.ini (position is/etc/php.ini) No, copy a Php.ini.default

In:

Pdo_mysql.default_socket=/tmp/mysql.sockmysql.default_socket =/tmp/mysql.sockmysqli.default_socket =/tmp/ Mysql.sock

These three all modify well ~

And then

sudo apachectl stopsudo apachectl start

You can have it.

See Phpinfo () under the Mysql.sock is changed ~

MySQL Error-Modify Mysql.sock location

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.