I have a strange problem in php MySQL:
php connects with
localhost must be defined in your hosts file, which it is by default on Windows and most OSs.
Check the following text file and see what's up:
Please note "hosts" is the file, no extension, it's not a folder. This file should be pretty much empty, if you see entries either your AV/spam blocker added a ton of entries that point to 127.0.0.1 or nasty malware has written garbage in there, despite, newer entries are below older ones. Localhost should be the first entry in that file.