Access denied for user 'ODBC'@'localhost' (using password: NO)
Posted by: DeathfireD (---.hsd1.nh.comcast.net)
Date: March 08, 2007 09:20AM

this seems like its been posted in the past but it the issues other's have had are not like mine, at least I don't think. I've used wamp on a few computers so i installed it on my new computer. Everything runs fine but when I try and do anything involving mysql I keep getting
"Access denied for user 'ODBC'@'localhost' (using password: NO)" and then erros pointing to lines in my code that try and manipulate my sql table.

My first thought was maby I did the database connection wrong in php but that was not the case since it runs fine on the other computers i have. So im a bit confused as to whats going on here.

Any suggestions.

PS. Im using latest wamp and my mysql username and password are the default ones for simplicity to make sure the stuff works.

edited well apparently I can create tables just fine but i cant add or manipulate data. I used this to test the connection and make a table and it worked.

<?php
// Make a MySQL Connection
mysql_connect("localhost", "root", ""winking smiley or die(mysql_error());
mysql_select_db("test222"winking smiley or die(mysql_error());

// Create a MySQL table in the selected database
mysql_query("CREATE TABLE example(
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
name VARCHAR(30),
age INT)"winking smiley
or die(mysql_error());

echo "Table Created!";

?>

Edit 2 my bad the reason why nothing seemed to work is becuse in php by default <? does not work only <?php so my scripts where messing up I think. Im going to change the settings and see if that fixes my problems.


Solved haha ya that was the reason why. How silly of me sad smiley .



Post Edited (03-08-07 09:32)

^)^ DeathfireD ^)^

Options: ReplyQuote
Re: Access denied for user 'ODBC'@'localhost' (using password: NO)
Posted by: srki (62.193.139.---)
Date: March 08, 2007 01:45PM

I had the same problem and I just registered user ODBC in phpMyAdmin, give him some password and after that return to privileges and grant all rights and set password to - No password.

I hope this is OK method becouse it works well on my comp.

Cheers



no means no

Options: ReplyQuote
Re: Access denied for user 'ODBC'@'localhost' (using password: NO)
Posted by: DeathfireD (---.hsd1.nh.comcast.net)
Date: March 09, 2007 03:59AM

well my issue was not the user name and password, as i posted above. It was the fact that I didnt change the default valued of <?php to allow <? use in the php.ini file. Once I changed that everything worked fine.

The reason why it was giving off the db error was becuse it simply couldnt read the config.php file I made because I didn't use <?php



^)^ DeathfireD ^)^

Options: ReplyQuote


Sorry, only registered users may post in this forum.