In mac, php is connected to the mysql database. localhost cannot be used when setting the mysql address, and only 127.0.0.1 can be used. Will php not be checked from hosts? In mac, php is connected to the mysql database. localhost cannot be used when setting the mysql address, and only 127.0.0.1 can be used.
Will php not be checked from hosts?
Reply content:
In mac, php is connected to the mysql database. localhost cannot be used when setting the mysql address, and only 127.0.0.1 can be used.
Will php not be checked from hosts?
Use in LinuxLocalhost
By defaultSockConnection,127.0.0.1
Is to useTcpTo connect
Php. ini has the following configuration item:
Mysql. default_socket =
Try to change to the corresponding mysqld. sock file, for example:
Mysql. default_socket =/var/run/mysqld. sock
Remember this one:MysqlLocalhost and 127.0.0.1 are not equivalent.
Well, the black pot should not be deducted to php, which is clearly a problem with mysql.
Select user, host from mysql. user;