collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: mysql_connect error  (Read 2899 times)

0 Members and 2 Guests are viewing this topic.

Offline maziken

  • BeBot Rookie
  • *
  • Posts: 4
  • Karma: +0/-0
mysql_connect error
« on: January 25, 2010, 05:55:02 am »
I searched the forums and found the other thread on this but it did not solve my problem.  This is the message I keep getting.  I tested to see if I can login to the SQL server using the created username and it is working fine.  Any ideas?

Quote
Curl extension loaded

Warning: mysql_connect(): [2002] A connection attempt failed because the connect
ed party did not  (trying to connect via tcp://localhost:3306) in C:\Bebot\Sourc
es\MySQL.php on line 129

Warning: mysql_connect(): A connection attempt failed because the connected part
y did not properly respond after a period of time, or established connection fai
led because connected host has failed to respond.
 in C:\Bebot\Sources\MySQL.php on line 129
MySQL ERROR(# 1) on query: Cannot connect to the database server at localhost as
 user root!
A connection attempt failed because the connected party did not properly respond
 after a period of time, or established connection failed because connected host
 has failed to respond.

Offline maziken

  • BeBot Rookie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: mysql_connect error
« Reply #1 on: January 25, 2010, 06:08:28 am »
Ack.  I fixed it myself.  >.<

Apparently, the latest version of PHP coupled with the latest version of MySQL doesn't like "localhost" as a valid server name.  Changed it to 127.0.0.1 and it connects just fine.  This is with Windows 7 as an OS.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: mysql_connect error
« Reply #2 on: January 25, 2010, 09:44:31 am »
The difference between localhost and 127.0.0.1 for MySQL is that localhost will use a pipe/socket connection while 127.0.0.1 will use a TCP/IP connection.

Not sure if the default MySQL settings now come with piping disabled by default.
BeBot Founder and Fixer Kingpin

Offline Arawacian

  • BeBot Rookie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: mysql_connect error
« Reply #3 on: March 07, 2010, 03:30:41 pm »
Additionally it seems that in Windows 7, Microsoft decided to not have localhost 127.0.0.1 in your hosts file anymore...

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 123
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal