1

I have had a WAMP setup on my winXP laptop for many years with no problems.

But about 2 months ago I installed SiteKiosk (kiosk software that creates a 'shell' around the OS) on my laptop. Afterwards my HeidiSQL software quit working:

sql error (2003) in statement #0: can't connect to mysql server on '127.0.0.1' (10061)

... so I have been using my browser-based phpmyadmin to connect/access my mysql since then.

About 2 weeks ago I uninstalled siteKiosk, but heidiSQL still wouldn't work.

.

Today I went to a client meeting at the client's office, with my laptop, to show them a new webapp. I did not connect to their wireless network. It is very common for me to demo webapps while being un-connected; I don't need to be, of course, because the webapps run on my localhost.

But today the webapp threw a php error:

Warning: mysqli::mysqli() [mysqli.mysqli]: [2002] 
N  o connection could be made because the target machine actively 
(trying to connect via tcp://localhost:3306) in 
C:\Server\htdocs\keleia.com\clients\client_prevent_deloza
     \project_uDesign\php\pkg_meekrodb.php on line 177

... this is line 177:

$mysql = new mysqli($this->host, $this->user, $this->password, 
         $this->dbName, $this->port);

After the meeting, I came home, with my computer now connected to my home network, and the webapp worked fine. And so then I intentionally disconnected from my network, and again the webapp threw the 'not connected to mysql' error.

Any Thoughts about what is going on?

Charles
  • 50,943
  • 13
  • 104
  • 142
dsdsdsdsd
  • 2,880
  • 6
  • 41
  • 56
  • This sounds like a firewall issue. – Barmar Jun 05 '14 at 20:37
  • Barmar, I haven't touched my firewall in probably 5 years. Unless the kiosk software did something to it. – dsdsdsdsd Jun 05 '14 at 20:40
  • My guess is that the kiosk software adjusts the firewall. – Barmar Jun 05 '14 at 20:40
  • So I suppose a good test would be for me to: 1) disconnect from my wireless network; 2) disconnect my firewall; 3) refresh the webapp ... – dsdsdsdsd Jun 05 '14 at 20:44
  • the webapp still did not connect to mysql, even when the firewall was turned off AND the wireless was disconnected. – dsdsdsdsd Jun 05 '14 at 20:48
  • 2
    It could also be a MySQL configuration issue. It sounds like it's only configured to listen on the NIC IP, not localhost. I'm not sure where that would be in the MySQL config file. – Barmar Jun 05 '14 at 20:49

1 Answers1

0

try to do "ping localhost" in cmd, compare the ip adresses with connected wifi and not.

if it's different so check your hosts file, or manually add line

127.0.0.1    localhost
num8er
  • 18,604
  • 3
  • 43
  • 57
  • num8er ... indeed I do get a different result if I am connected vs. disconnected. ... .... ... when DISconnected I get these: "Reply from 127.0.0.1: bytes=32 time<1ms TTL=128" ... ... ... but when connected I get these: "Reply from ::1: time<1ms" ... ... ... ... should they be the same?? – dsdsdsdsd Jun 05 '14 at 21:30
  • so try to use "127.0.0.1" as host (not "localhost") it's probably because there is no permissions for user with host: ::1: in mysql.User table. – num8er Jun 05 '14 at 21:35
  • in windows: windows\system32\drivers\etc\hosts in linux: /etc/hosts open the file and add: 127.0.0.1 localhost or just use "127.0.0.1" in your scripts instead of "localhost" – num8er Jun 05 '14 at 21:53
  • You can also change mysql's configuration file and change the parameter to listen from all ip adresses: bind-address = 0.0.0.0 – num8er Jun 05 '14 at 21:57
  • num8er, it turns out that "127.0.0.1 localhost" was already in the host file. – dsdsdsdsd Jun 05 '14 at 22:04