2

I'm trying to connect to the MySQL server that came with WAMPServer locally using SQLYog, but it gives me this error:

Error No. 2003

Can't connect to MySQL server on 'localhost' (10061)

However, phpmyadmin works just fine, and mysql_connect() works fine with the WAMP's default login details:

hostname: localhost

username: root

password: empty

The server's on, why can't I connect to localhost on SQLYog with root, when phpmyadmin works fine?

Happens with HeidiSQL too. Does anyone have an idea? Thanks.

Community
  • 1
  • 1
bryc
  • 12,710
  • 6
  • 41
  • 61
  • Is this all happening on one and the same server? What address do you use to open phpMyAdmin? – Pekka Feb 04 '12 at 17:26
  • it's just one machine--an XP laptop, and the phpmyadmin address is http://127.0.0.1/phpmyadmin – bryc Feb 04 '12 at 17:32
  • Hmm. Do you have a Firewall running? – Pekka Feb 04 '12 at 18:29
  • The Windows default firewall is, I had tried disabling it entirely, but that had no effect. – bryc Feb 04 '12 at 19:30
  • 1
    That sounds weird. Have you tried `127.0.0.1` instead of `localhost`? – Pekka Feb 04 '12 at 19:34
  • Aren't they the same thing? I _have_ tried both, though. phpMyAdmin uses the former only because of an alias with `allow from 127.0.0.1`. – bryc Feb 04 '12 at 21:55
  • Never use root to connect your program to the server. Go through the effort to set up a user with appropriate GRANT capabilities. This applies even to testing. – dar7yl Feb 04 '12 at 23:09
  • Please read this FAQ: http://webyog.com/faq/content/23/15/en/error-no-2003-can_t-connect.html This is a connection error and not an authentication error (ie. not password etc. problem). First of all check for firewall setings on the server and the client machine. – Sathish D Feb 06 '12 at 04:18

2 Answers2

3

I had the same issue in HeidiSQL, turned out my plink timeout was too low. As soon as I increased the timeout, my problem was solved!

jesal
  • 7,852
  • 6
  • 50
  • 56
  • 2
    OMG I've been tearing my hair for over an hour looking credentials and SSH key on my Openshift Instance, and simply increasing the timeout value fixed it. Thanks! – Arda Jun 30 '15 at 18:03
  • 1
    @Arda Good to hear! :) – jesal Jun 30 '15 at 20:08
0

You must use plink connect the mysql host if that is never connected firstly plink -v -L 10085:host:3306 user@host

And then config HeidiSQL normally