MySQL is not comunicating with PHP no localhost connection

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Raz
Forum Newbie
Posts: 4
Joined: Sun Dec 05, 2004 5:20 pm
Location: Romania

MySQL is not comunicating with PHP no localhost connection

Post 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 :?:
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post 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?
User avatar
Raz
Forum Newbie
Posts: 4
Joined: Sun Dec 05, 2004 5:20 pm
Location: Romania

Access denied for user 'ODBC'@'localhost'

Post 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? :?:
User avatar
Raz
Forum Newbie
Posts: 4
Joined: Sun Dec 05, 2004 5:20 pm
Location: Romania

Post 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
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post 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.
Post Reply