access problem with mysql

Alles, was PHP betrifft, kann hier besprochen werden.

access problem with mysql

Postby dannyF » 13. February 2007 17:47

I installed xampp mysql with username as root and no password. I checked the phpMyAdmin and root user has all privildges. When I try to insert into a table I get the following error message:

Access denied for user 'ODBC'@'localhost' (using password: NO)

The problem is not with my connection because my php pages will display records that are already in the table, I just can't add new ones. The existing ones were inserted using a backup file.

Can someone tell me what is wrong and how to fix it?

Thanks
Dan
dannyF
 
Posts: 5
Joined: 13. February 2007 17:34

Postby Wiedmann » 13. February 2007 17:55

When I try to insert into a table I get the following error message:

With PHP?

Access denied for user 'ODBC'@'localhost' (using password: NO)

If yes, then there are something wrong with your code (look for the function mysql_connect())
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

access problem with mysql

Postby dannyF » 13. February 2007 18:25

Yes, PHP5 as included in XAMPP.
Dan
dannyF
 
Posts: 5
Joined: 13. February 2007 17:34

access problem with mysql

Postby dannyF » 13. February 2007 18:30

If the problem was with my connection, would I be able to view records already in the table?

I'm using a DB class that I have used hundreds of times before including with the current script on my home computer that has Apache, PHP5 and mysql installed. The only difference is that I have not used mysql5 before. I have only used mysql4.

Is there something in the new version of mysql that could be causing this?
Thanks
Dan
dannyF
 
Posts: 5
Joined: 13. February 2007 17:34

access problem with mysql

Postby dannyF » 13. February 2007 19:02

I just clicked on the Admin button beside mysql in the xampp control panel and WinMySQLadmin openned. In the Environment Tab under MyODBC it said "Driver 3.51 not found".

Do you know if this could be my problem? Is this driver part of xampp or should it be part of windows.

I'm using a machine with Windows 2000 installed.

Thanks
Dan
dannyF
 
Posts: 5
Joined: 13. February 2007 17:34

Postby Wiedmann » 13. February 2007 19:10

If the problem was with my connection,

Just look at the error message:
Access denied for user 'ODBC'@'localhost' (using password: NO)

Your script (class) doesn't use any user information in the connection, which the script uses for the INSERT query. With "normal" PHP (without a class) this is:
Code: Select all
$db = mysql_connect();
or
$db = mysql_connect('localhost');


would I be able to view records already in the table?

Maybe, this depend on your MySQL user configuration (if you have an anonoumus user).

Or your script (class) did use another connection (with user informations) for the SELECT query.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

access problem with mysql

Postby dannyF » 13. February 2007 19:47

What a waste of time - you were right on. I had removed
"include(DBFILE)" from my header file but then forgot to put it in the admin file.
Thanks, Weidmann, for hanging in with me.
Best wishes
Dan
dannyF
 
Posts: 5
Joined: 13. February 2007 17:34


Return to PHP

Who is online

Users browsing this forum: No registered users and 4 guests