#2002 Cannot log in to the MySQL server PhpMyadmin Snow Leopard 10.6.7

This was on my Mac with Snow Leopard 10.6.7 Desktop with mysql and phpmyadmin just installed

When I first tried to log in to phpMyAdmin as root I got this error:

#2002 Cannot log in to the MySQL server

This is what I did to fix it.

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
 

 

  Now I get this error:

phpMyAdmin -

Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.

back to php.ini and uncomment the session.save_path.   Remove the ";"

; http://php.net/session.save-path
session.save_path = "/tmp"
 

restart apache: sudo apachectl restart

 

Now its working. Still get some warnings but I can do what I need to do..