mysql_connect cannot connect localhost

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FalconIA
    New Member
    • May 2010
    • 3

    #1

    mysql_connect cannot connect localhost

    After I updated php from 5.3.0 to 5.3.2,
    mysql_connect cannot connect localhost but 127.0.0.1.
    It shows:
    Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in ........

    And drivers\etc\hos ts seems good.

    Is there anyone knows what happened?
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    What is the contents of your hosts file?

    Comment

    • FalconIA
      New Member
      • May 2010
      • 3

      #3
      Originally posted by Markus
      What is the contents of your hosts file?
      127.0.0.1 localhost

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        That's unusual. Nothing comes to mind. I'd file a bug report.

        Comment

        • FalconIA
          New Member
          • May 2010
          • 3

          #5
          Post here:

          Comment

          • chathura86
            New Member
            • May 2007
            • 227

            #6
            i got the same kind of problem once (when i got a pc with fresh vista installation), the problem was vista did not properly resolve the host file. i did not found any proper solution either, anyway check about this issue also if you did not find any good solution. (could be ipv6 not sure)

            Regards

            Comment

            Working...