Display when starting MySQL:/tmp/mysql.sock non-existent workaround

Source: Internet
Author: User

Can ' t connect to local MySQL server through socket '/tmp/mysql.sock '

The above tips may be encountered when starting MySQL, that is, in the/tmp/mysql.sock location can not find the required mysql.sock files, mainly due to the my.cnf file in the Mysql.sock location settings.

Mysql.sock default is in/var/lib/mysql, if it is found in this directory, you can add Mysql.sock path under [mysqld]
VI/ETC/MY.CNF (my.cnf may also be under other paths)

[Mysqld]
Port = 3306
Socket =/var/lib/mysql/mysql.sock

However, to ensure that users who use MySQL have write access to the directory, such changes will still be error due to permission restrictions.

So to avoid permission problems, you can also use soft links to create a join to/tmp/mysql.sock for/var/lib/mysql/mysql.sock

Ln-s/var/lib/mysql/mysql.sock/tmp/mysql.sock

Because the/tmp/folder defaults to other W permissions, you can avoid permissions issues.

In addition, if you find that Mysql.sock is not in the default/var/lib/mysql location, one workaround is to use the Find command to search for the location of the Mysql.sock and then choose one of the previous two solutions.

Display when starting MySQL:/tmp/mysql.sock non-existent workaround

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.