2002 Cannot log in to the MySQL server – MAC



To fix

In /etc/php.ini, replaced the three occurences of /var/mysql/mysql.sock with /tmp/mysql.sock

prompt% sudo chmod u+w php.ini   <- had to give myself write permission to that file..

you may need to become root user to actually edit the file.. depends who owns php.ini

Now edit it..  i vi

find:  pdo_mysql.default_socket=/var/mysql/mysql.sock
change to: pdo_mysql.default_socket=/tmp/mysql.sock

Find: mysql.default_socket = /var/mysql/mysql.sock
change to: mysql.default_socket = /tmp/mysql.sock

Find: mysqli.default_socket = /var/mysql/mysql.sock
change to: mysqli.default_socket = /tmp/mysql.sock

 

restart apache: sudo apachectl restart