ERROR 1045: Access denied for user: 'ODBC@localhost' <Using password: NO>

Posted on 2004-11-08
Last Modified: 2011-08-18

I'm getting the above error when trying to configure MySQL, after I type the following:

c:\mysql\bin\mysql mysql

I don't have the faintest idea what to do. (I have another question open related to this subject, but unfortunately I let the problem go waaay to long and the question is too old.).

Can anyone help me, with very explicit instructions. This is my first experience with MySQL. Thanks.

Question by:kara334
    LVL 8

    Accepted Solution

    With  c:\mysql\bin\mysql mysql you are connecting to the MySQL database server as an anonymous user, in the case of Windows the default user name is ODBC if you do not provide one.

    The anonymous user in the default installation only has privileges to access the `test` database. You are trying to access the `mysql` database which cause the access denied.

    If you want to access the `mysql` database, you have to use the root user.
    c:\mysql\bin\mysql -u root mysql
    should do the trick.
    If you have set a password for the root user then you have to add the -p option
    c:\mysql\bin\mysql -u root -p mysql

    To find out all the available options of mysql, run c:\mysql\bin\mysql --help


    Author Comment

    Thank you so much! Do you know how many hours I struggled with this? Here are your well deserved points!
    LVL 1

    Expert Comment

    Looks like you simply havent supplied a password or username. Check the code/config file for username and password.

    Expert Comment

    someone tell me pls .. how can i change the pass root from default instalation when i am allready sing in with an anonymous account. from old version of mysql  ( 4.0.21 ) on (Documentation ) was a line command with change root pass from default, but now can`t find that line and i want to use the newversion and have the same problem.

    witch is THAT line ?

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    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 …
    Creating and Managing Databases with phpMyAdmin in cPanel.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    728 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

    20 Experts available now in Live!

    Get 1:1 Help Now