There is a problem, using online methods are not good use, for advice

Source: Internet
Author: User
Warning:mysqli_real_connect (): (hy000/2002): No such file or directory in


Reply to discussion (solution)

Too little information to provide

For some reason MySQL in OS X gets the locations of the required socket file a bit wrong, but thanks to a veritable wizard I know (that's you, Gavin) the solution are as simple as setting up a symbolic link.

A socket (appearing as a zero length file) As/tmp/mysql.sock Or/var/mysql/mysql.sock but 1 or more apps are Looking in the other location for it.

Rather than move the socket and has to edit config files and remember to keep edited files local and away from servers wh Ere the paths is correct, simply create a symbolic link so your Mac finds the required socket, even when it's looking in The wrong place!

If you have/tmp/mysql.sock and No/var/mysql/mysql.sock then ...

Cd/var sudo mkdir mysqlsudo chmod 755 mysqlcd mysqlln-s/tmp/mysql.sock Mysql.sock


If you have/var/mysql/mysql.sock and No/tmp/mysql.sock then

Cd/tmpln-s/var/mysql/mysql.sock Mysql.sock


You'll need permissions to create the directory and link, so just prefix the commands above with sudo if necessary.
  • 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.