Page 1 of 1

MySQL is not comunicating with PHP no localhost connection

Posted: Sun Dec 05, 2004 5:26 pm
by Raz
MySQL is not comunicating with PHP on my testing localhost. The mysql server is ok but i get a "cannot connect to database" and stuff or from another interogation "mysql_connect(): Can't connect to MySQL server on 'localhost' (10061)"

I'm using win XP, apache 2.0.49, mysql 4.1.7, php 4.3.6 !!!

Can somebody help me? I'm realy stuck :?:

Posted: Sun Dec 05, 2004 6:48 pm
by kettle_drum
Are you using the correct username and password? Is this user allowed to connect from the local host? Can you connect to it when running mysql in the command line?

Access denied for user 'ODBC'@'localhost'

Posted: Mon Dec 06, 2004 4:37 am
by Raz
Good tip!

I tried and this is what I get:

Code: Select all

C:\apache\mysql\bin>mysql
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)
what is ODBC doing here? :?:

Posted: Mon Dec 06, 2004 6:43 am
by Raz
Ok my user from my.ini doesn't work. I'm using the 'root' thing and it is connecting but something happens with fetch_row. Oh gosh!! 8O

Code: Select all

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in F:\Diverse\TestNest\test.php on line 26

Posted: Tue Dec 07, 2004 9:14 am
by Maugrim_The_Reaper
Read the php manual on usage of mysql commands. The resource is the resource pointer created while connecting, e.g., $db = mysql_connect() - $db

Manual makes it all pretty clear if you read through it.