Solved

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

Posted on 2006-06-19
3
1,213 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

786 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