cannot find mysql-sock on mac, using localhost instead of 127-0-0-1

how can i find mysql.sock file on mac
want to connect mysql in php using "localhost" instead of "127.0.0.1"
MYSQL_SOCK LOCATION MAC

Submitted by sunil On Thursday, 14 May 2015.
Category: MySql

[RESOLVED]

0
1 Answers.
 
Super User
crooker

Re:cannot find mysql-sock on mac

first run the following command in terminal
mysqladmin variables


then search for "socket" in the result,

then copy the value of "socket" variable from last command result, and put it under PHP.ini's (normal location is "/private/etc/php.ini") as bellow

mysql.default_socket = /tmp/mysql.sock
Submitted by Super User On Thursday, 14 May 2015
0
This Answer has been Chosen as Best Answer
Question is marked as resolved.