Why I can not connect to MYSQL Server on my local machine when my network adapters are not connected to a network.?

Posted on 2009-04-30
Last Modified: 2012-05-06
I am developing a web site by php. Apache2.2 and Mysql Server 5.1 and PHP5 are installed on my computer. For a week i went on with my development without any problem, it was so easy to test my pages from localhost, i was having no problem to manage the database by phpmyadmin. But today i noticed that i'm not able to connect to MySql server when my network adapters are not connected to a network. When any of my network adapters are connected to any network with a valid ip address, i can connect to MYSQL via console, phpmyadmin or mysql_connect() function in php. But when i unplug my ethernet cable and disable my wireless network adapter, i get the following error. I've done exactly the same Php apache mysql installations on to my Desktop computer and Notebook computer. This problem does not occur on my desktop but occurs on my notebook. The only difference between these two are, Win XP Pro Sp3 is installed on my desktop, Win XP Home Sp3 is installed on my notebook.

Does any one have an idea about it?
Error 2003 (HY000), Can't connect to Mysql Server on 'localhost' (10022)

Open in new window

Question by:ilteris
    LVL 14

    Expert Comment


    Your mysql sever is not running now .Please do manualy.
    LVL 14

    Expert Comment

    Have you changed the location for mysql data files? (with a datadir=C:\<some path>
    command in your my.ini file) is a table created in your database for MySQL's own use.
    If it can't find it, either you've specified a new data file path and
    not moved the files to the new location, or there was some kind of problem
    during installation and the data files weren't created.
    LVL 14

    Accepted Solution


    that error message suggests to me that the MySQL server isn't active, or there is something between the applciation and the server tha is blocking connection (eg a firewall or proxy server/ NAS)

    so I'd want to first of all prove MySQL is actaully running
    in windows look for a process called mysqld-nt.exe

    if you are running a firewall make sure the specified port is open (usually MySQL runs on 3306

    if thats working then I'd suggest you download the mySQL graphical tools from the MySQL site and see if either query browser and or Adminstrator can connect to the specified server.

    after that it cvould be the app is not looking for the correct mYSQL server.... ie there are some config steps needed to get the app to talk to the required server.

    if your server isn't on the same machine as the application that is generating the localhost message then its a config issue.

    Hope this will help you.


    Author Closing Comment

    Seems like you are right with the firewall thingy. I checked task manager and verified that mysqld.exe is running. My internet security software (Bullguard 8.5) seems to block mysql connection somehow. My firewall does not block when my computer is connected to a network, but when all my network adapters are disabled (when i was on a bus), i guess my firewall is blocking all connection attempts including localhost.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    Suggested Solutions

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now