I have a strange problem in php MySQL:
php connects with 127.0.0.1 but not with localhost.
127.0.0.1
localhost
How to solve this issue?
Try ping localhost in a command line, it may be resolving to ::1: the IP6 equivalent to 127.0.0.1
ping localhost
::1:
To fix it, add (or uncomment) the line:
127.0.0.1 localhost
in C:WINDOWSsystem32driversetchosts
C:WINDOWSsystem32driversetchosts
1.4m articles
1.4m replys
5 comments
57.0k users