Solved

Mysql error msg :" Access denied for user 'ODBC'@'localhost'  (using password: NO)"

Posted on 2006-06-19
3
1,210 Views
Last Modified: 2007-12-19
I receive this error msg :"Access denied for user 'ODBC'@'localhost' (using password: NO)" when i try and access a mysql database with php. I even receive the msg when i try a simple database connection featured in the code below:

$link = mysql_connect("localhost", "username", "password")
   or die ("Could not connect: ". mysql_error());

The username and password are also correct and i have comformed that. Does anyone have any ideas?
0
Comment
Question by:cjevic
3 Comments
 
LVL 10

Accepted Solution

by:
Khanh Doan earned 500 total points
ID: 16939050
Have you ever try connect to your db by phpMyAdmin ?
Do you install ODBC or smth else like that ? 'Cause ODBC is Open Database Connectivity and it used by Windows user.
0
 
LVL 14

Expert Comment

by:ppfoong
ID: 16939169

The message (using password: NO) means that you did not pass any password information to the connection, assuming that there is no password required. If there is a password, you need to connect using the -p parameter, and there should be no space between -p and the actual password. Eg. if the password is 12345, you should put -p12345 .

In addition, if you can login with other user such as root@localhost, you can check the permission for ODBC@localhost using this command:

SHOW GRANTS FOR ODBC@localhost;
0
 
LVL 2

Expert Comment

by:PurpleSlade
ID: 17111671
Out of curiosity, are you trying to access the database from another script?  If not and you get this message, are you sure that MySQL *server* is running?  You might try typing

'net start mysql' in the command window to make sure to see if it is installed as a service.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now