localhost
.localhost
or just use 127.0.0.1mysqli_connect()
in php might be using localhost
to connect to MySQL: You can't (shouldn't have to) go about replacing localhost
with 127.0.0.1
in every script.bind-address=localhost
, socket=/var/mysql/mysql.sock
, socket=/tmp/mysql.sock
etc. to the my.cnf file, but that didn't work.mysql.default_socket
setting in /etc/php.ini
file points to /var/mysql/mysql.sock
, while MySQL's default_socket is /tmp/mysql.sock
.php.ini
file, or create a softlink to MySQL's default_socket: