[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2006-06-19
3
Medium Priority
?
1,235 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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month18 days, 16 hours left to enroll

834 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