PHP - MYSQL - test database server

前端 未结 3 1960
遇见更好的自我
遇见更好的自我 2020-12-09 23:51

I\'m learning PHP MYSQL and trying to create a database.

I\'m following this tutorial http://www.raywenderlich.com/2941/how-to-write-a-simple-phpmysql-web-service-f

3条回答
  •  孤街浪徒
    2020-12-10 00:01

    This seems to be a common issue, as googling for it yields quite a few results. I experienced this on my two linux boxes as well (never under Windows though) and at some point I resolved to just use 127.0.0.1 on all dev servers. Basically, localhost makes the connection to the MySQL server use a socket, but your configuration doesn't point to the socket file correctly.

    Here are a couple of resources that you might find useful:

    http://westsworld.dk/blog/2011/03/problems-connecting-to-unixvarmysqlmysql-sock/ - basically what @Jack suggests, but more in depth

    Can't connect to MySQL on Mac -- missing mysql.sock file - here's how to locate your socket file (for some reason, my php.ini had the path wrong, and I assume your case could be similar).

    I hope this helps.

提交回复
热议问题