floridaflatlander Posted June 3, 2014 Share Posted June 3, 2014 (edited) Most of the time my localhost works like a champ but occasionally I get ... mysqli_connect() [function.mysqli-connect]: (HY000/2005): Unknown MySQL server host 'localhost' (11001)On phpfreaks I've searched for "Unknown MySQL server host localhost " and didn't see an answer to this problemThen I googled and found this http://stackoverflow.com/questions/16580370/mysql-error-2005-unknown-mysql-server-host-localhost11001However in this file the localhost ip is commented out and windows wont let me edit the file to uncomment it like it's done in the stackflow post. So, one is this the likely problem ... and if it is how do I edit a file in the Windows folder? As a note I do go into the file as the administrator using notepad Thanks Edited June 3, 2014 by floridaflatlander Quote Link to comment https://forums.phpfreaks.com/topic/288961-occasional-unknown-server-host-mysqli_connect-functionmysqli-connect-hy0002005/ Share on other sites More sharing options...
dalecosp Posted June 3, 2014 Share Posted June 3, 2014 (edited) Don't know your Windows version, but something like this should do the trick.Run a "Command Prompt" as Administrator. (If you can find a shortcut to the Command Prompt, RIGHT-click and choose "Run as Administrator").The Administrator Command Prompt should put you in the system32 directory, and the prompt should look like this: c:\windows\system32> At the prompt, type "notepad drivers/etc/hosts", and add the line noted in the S.O. post to your HOSTS file. Save the file, and then try the command "ping localhost" at the prompt. Edited June 3, 2014 by dalecosp Quote Link to comment https://forums.phpfreaks.com/topic/288961-occasional-unknown-server-host-mysqli_connect-functionmysqli-connect-hy0002005/#findComment-1481759 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.