1

enter image description hereI have installed the WAMp server on my windows XP machine.

When I am trying to connect to DB it give the following error.

Warning: mysql_connect() [function.mysql-connect]: [2002] No connection could be made because the target machine actively (trying to connect via tcp://localhost:3306) in C:\wamp\www\demo.php on line 2

I have attached my list of active services. You can see that I no service installed at port 80.

So, When i have installed the WAMP, I have to use http://localhost:81 for my root folder.

My PHP myadmin is working fine, but don't know how. enter image description here

have anyone faced this type of problem before.?

Please let me know if you have solution for this..

Avinash
  • 181
  • 1
  • 2
  • 9
  • CMD propmpts allow you to copy and paste. To copy: right click, mark, highlight text, [enter]. To paste: right click, paste. This should help so you don't have to upload massive (unsearchable) images. – Chris S Oct 11 '11 at 13:51

4 Answers4

2

This question is very confused.

Title suggests problem connecting to port 3306 (which is where mysql usually hangs out). There is no list of active services. What does a service at port 80 have to do with anything?

I have to use http://localhost:81 for my root folder.

Why do you have to use port 81? What do you mean by your "root folder".

I suspect the problem is that mysqld is running OK (since you connect using PMA) but the client attaches special significance to the name 'localhost' and will try to use a filesystem socket instead of a network socket.

In a DOS shell, run 'netstat -a' to check if mysqld really is listening on port 3306 - and on which addresses. Try connecting to the address/port listed in netstat (use 127.0.0.1 NOT localhost)

symcbean
  • 21,009
  • 1
  • 31
  • 52
  • Sorry forgot to add screen shot, I have also attached the screen shot with "netstat -a" command. I am not able to find the 3306 port. – Avinash Feb 18 '11 at 17:08
  • Thanks for the help, I have solved my self, will post the solution sortly... – Avinash Feb 18 '11 at 17:12
1

in mysql.ini file port was defined to 3307 I have changed it to 3306 and its works great.

@symcbean : thanks for your time..

Avinash
  • 181
  • 1
  • 2
  • 9
1

I added a rule to the Norton Internet Security program. The rule was that it was OK to allow my PC (given by the IP address) to use TCP for ports 8080 and 3306 for Local use. That worked fine today to fix the problem.

I was using Windows 7, PHP and PhpED Pro 6.1 in October 2011 when I had the problem of connecting to the MySQL DB on my PC.

0

Did you open the port in Windows Firewall? Even connecting back to localhost:3307 will get blocked if it isn't opened in the firewall. 3306 may have been opened by the installer already, which is why it works.

ed209
  • 392
  • 1
  • 5