Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
Raz
Forum Newbie
Posts: 4 Joined: Sun Dec 05, 2004 5:20 pm
Location: Romania
Post
by Raz » Sun Dec 05, 2004 5:26 pm
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 » Sun Dec 05, 2004 6:48 pm
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?
Raz
Forum Newbie
Posts: 4 Joined: Sun Dec 05, 2004 5:20 pm
Location: Romania
Post
by Raz » Mon Dec 06, 2004 4:37 am
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?
Raz
Forum Newbie
Posts: 4 Joined: Sun Dec 05, 2004 5:20 pm
Location: Romania
Post
by Raz » Mon Dec 06, 2004 6:43 am
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!!
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
Maugrim_The_Reaper
DevNet Master
Posts: 2704 Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland
Post
by Maugrim_The_Reaper » Tue Dec 07, 2004 9:14 am
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.