Solved

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

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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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