ERROR 2005 (HY000): Unknown MySQL server host 'localhost' (0)

sonicimpulse used Ask the Experts™
I setup a new MSQL Server on a new laptop.  I'm trying to import the data dump to the new server and I get the following error:

ERROR 2005 (HY000): Unknown MySQL server host 'localhost' (0)

I'm not sure what is causing this.  Never had this issue before.  Any help would be greatly appreciated.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Kerem ERSOYPresident


I seems that your MySql Server is not running. Try to start MySQL. You told Laptop but did not mention what os you're using so I cant send you the exact directions on hoe to start and check your MySql server.

Director of Solutions Consulting
If you are sure the server is running an its on the standard port Sometimes I've seen localhost not work right. Try instead

Try to add this line to your hosts file:	localhost

Open in new window

Hosts file in linux usually is /etc/hosts, on Windows $WINDOWS_PATH\system32\drivers\etc\hosts (replace $WINDOWS_PATH with path to your Windows folder (usually C:\Windows)).
Should you be charging more for IT Services?

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!


I'm using windows 7.

I'm not a SQL Administrator in anyway.

Please tell me the name and location of these files you want me to edit.

You should be able to see it in my previous post.

Just in case:
On Windows hosts file is in:  $WINDOWS_PATH\system32\drivers\etc\hosts (replace $WINDOWS_PATH with path to your Windows folder (usually C:\Windows)).

TLDR: C:\Windows\system32\drivers\etc\hosts

This file is like local DNS server. You can find more information anywhere, for example WIKI.
You can try following ways:

* use: localhost or or your computer name
* be sure you're connected to database with password
* set new root password to your mysql server


I'm completely lost here.  This is all new to me.

I'm using the workbench if that helps.
Read This it's useful for you (i think)

MySQL Refrences
if you use mysql for PHP coding i recommend which you use XAMPP (Apache Friends)

you can download it from here.

also you can use mysql workbench for manage it...

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial