[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 686
  • Last Modified:

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

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

  • 3
1 Solution

Your mysql sever is not running now .Please do manualy.
Have you changed the location for mysql data files? (with a datadir=C:\<some path>
command in your my.ini file)

mysql.host 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.

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.

ilterisAuthor Commented:
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.

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now