A workaround appears that "/var/lib/mysql/mysql.sock" does not exist

Source: Internet
Author: User

Most of this is because your MySQL is installed using RPM, it will automatically look for/var/lib/mysql/mysql.sock this file,
Log in to MySQL via a UNIX socket.
Common solutions are as follows:
1.
Create/Modify file/etc/my.cnf, add/modify at least one row
[MySQL]
[Client]
Socket =/tmp/mysql.sock
#在这里写上你的mysql. Sock the correct position, usually not under/tmp/or under/var/lib/mysql/

2.
Specify an IP address to connect to MySQL using TCP instead of using the local sock method
#mysql-h127.0.0.1-uuser-ppassword

I did it this way.

3.
Add a connection for mysql.sock, such as the actual mysql.sock under/tmp/, then
#ln-S/tmp/mysql.sock/var/lib/mysql/mysql.sock

A workaround appears that "/var/lib/mysql/mysql.sock" does not exist

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.