By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,408 Members | 1,576 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,408 IT Pros & Developers. It's quick & easy.

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

P: n/a
Hi all,

maybe this isn't a php question, but a MySQL question.

If so I'm sorry for asking you guys to help me :)

I know this question is asked often in NGs, but I couldn't find the
answer that works for me.

I've just installed my server with following:

Apache2, PHP5 and MySQL 4.1.12 on Windows 2000 Server.

Apache and PHP are funtioning properly (I can open a page like
phpinfo() ).

But now i've come upon a problem with MySQL.

When i try to run a simple PHP script like:
mysql_connect("localhost", "root", "password") or die (mysql_error());
I get the following error:
Can't connect to MySQL server on 'localhost' (10061)

I've tried several different addresses like: localhost, 127.0.0.1,
server01, 192.168.0.3 all with same result.

Loopback address should work cause I configured MySQL that way.

The MySQL service is started.

I don't know whether it's a good way to test the MySQL server but on
commandline I typed:
mysql --user=user_name --password=your_password
And I got mysql> commandline.

Can someone please help me find the problem and/or give a better way of
testing.

Thanks in advance for your replies.

P. Hordijk

Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
<pi************@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi all,
When i try to run a simple PHP script like:
mysql_connect("localhost", "root", "password") or die (mysql_error());
I get the following error:
Can't connect to MySQL server on 'localhost' (10061)

I've tried several different addresses like: localhost, 127.0.0.1,
server01, 192.168.0.3 all with same result.


Have you tried plugging in the phrase (in quotes) to Google?

This is a fairly common problem with an easy fix posted on the MySQL manual
pages.

Go to Google & put in: "Can't connect to MySQL server on 'localhost'"
(quotes included) - the answer is one of the top two responses.

It has to do with the passwords & latest versions of MySQL - the page on the
MySQL site you find will tell you how to fix it.
Jul 17 '05 #2

P: n/a
Thanks for your reply!

When i said i searched NGs, I meant I also searched Google (Could be
that I'm so retarded that I overlooked the sollution to my problem
though).

I followed your instruction to enter "Can't connect to MySQL server on
'localhost'" in google and I studied the results, none of them did the
trick for me.

Bout the password thingy: I couldn't find it (but like I said before
that could also be me being retarded), so I'm blushing when I ask you
the following: Can you give me the URL of the site where you found out
bout that password thingy and latest versions.

Do you still think this is a php question or do I need to post in a
MySQL NG?

I know I can be a pain in the ass :), so I thank all for taking the
time to help me.

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.