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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pieter_hordijk@hotmail.com

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

    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_p assword
    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

  • Tony

    #2
    Re: Can't connect to MySQL server on 'localhost' (10061)

    <pieter_hordijk @hotmail.com> wrote in message
    news:1117215914 .314713.220490@ f14g2000cwb.goo glegroups.com.. .[color=blue]
    > 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.[/color]

    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.


    Comment

    • pieter_hordijk@hotmail.com

      #3
      Re: Can't connect to MySQL server on 'localhost' (10061)

      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.

      Comment

      Working...