Can't start phpMyAdmin. Keep getting the #2002 socket error

前端 未结 9 1847
难免孤独
难免孤独 2020-12-31 05:44

I\'ve been trying to set mysql and phpMyAdmin for the last 12 hours, without any success. And yes, after hours and hours of Google-ing I know that is a common problem and I\

9条回答
  •  囚心锁ツ
    2020-12-31 05:59

    The problem I had with this was because PHP was trying to connect via a UNIX socket instead of TCP. This is similar to this error: Error when connecting to MySQL using PHP/PDO

    First, make sure you have a my.cnf config for mysql then add your default socket location:

    [mysqld_safe] socket = /tmp/mysql.sock
    

    Next in your php.ini, let PHP know where it is:

    mysql.default_socket = /tmp/mysql.sock
    

提交回复
热议问题