WebDevelopersNotes logo

home-icon Home / Answers / MySQL login error 1045 (28000): Access denied for user ODBC@localhost

MySQL login error 1045 (28000): Access denied for user ODBC@localhost

MySQL login error 1045 (28000): Access denied for user ODBC@localhost

I installed MySQL on a desktop PC (VISTA). But after typing “mysql” at the DOS prompt, I get an error message: “ERROR 1045 (28000): Access denied for user ‘ODBC’@’localhost’ (using password: NO)“. My question is how do I successfully login to use MySQL? I’ve heard of phpMyAdmin – isn’t this better? Thank you
Wayne

You cannot login at MySQL server with a simple mysql command at the prompt. It is bound to result in the MySQL login error 1045 (28000): Access denied error. Actually, the command is incomplete as the login details are missing.

Anyway, this is a very minor issue and can be solved quickly by using the correct MySQL login command at the terminal window.

Sponsored Links

Login at MySQL using the Command Line Client

The MySQL package comes with a Command Line Client (CLC) with which you can work with the database. The commands need to be typed in manually and this helps you in learning the language properly. I advise beginners to use the CLC because it provides a simple interface through which one can get a hands-on (literally) experience.

The MySQL Command Line Client can be launched from “All Programs” -> “MySQL” -> “MySQL Server 5.1” -> “MySQL Command Line Client“. You can also load it up from a terminal window, but simply typing mysql followed by the “Enter” key at the DOS prompt will throw the “ERROR 1045 (28000): Access denied for user ‘ODBC’@’localhost’ (using password: NO).

MySQL Error 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)

ERROR 1045 (28000): Access denied for user is displayed because you are not providing a password

To successfully login at MySQL you need to provide the password. For instance, if you launch the MySQL Command Line Client (image below), it waits for you to type in the password.

MySQL Command Line Client (CLC): enter password to login at the server

A simple “mysql” command at the DOS prompt is insufficient for logging in at MySQL. You need to use:

>mysql -u root -p

Wherein, root is the username and should be changed if your login information is different. The program now waits for you to enter the password which was set up when MySQL was installed on the Windows computer.

Should you use MySQL clients like phpMyAdmin?
Yes you can install phpMyAdmin on a Windows 7 machine (or Vista, in your case), but I recommend using it only when you’ve mastered at least the basic SQL commands.

Sponsored Links

Your comments
Star icon IMPORTANT Have a question / problem? Click here to ask an expert.

  • Brian Debolt on September 2nd, 2011 2:15 pm

    Thanks. That fixed it.

  • sabirne on January 6th, 2013 8:43 pm

    thanx a lot 🙂 it solved my problem

  • Fix Mysql Error Nr.1044-access Denied For User Windows XP, Vista, 7, 8 [Solved] on December 1st, 2014 9:49 pm

    […] MySQL login error 1045 (28000): Access denied for user … – Mar 07, 2011 · I installed MySQL on a desktop PC (VISTA). But after typing “ mysql ” at the DOS prompt, I get an error message: “ERROR 1045 (28000): Access denied …… […]

If it's on the Internet, it must be true.

Sponsored Links

Tips

How do I view a deleted web page?
Is there a way to view a deleted web page - one that is no longer available? Yes there is and the solution is quite simple. [more...]

Fact

In 2006, Time magazine honoured Wikipedia editors, meaning anyone in the world, with their "Person Of The Year" title! [more...]

We use cookies to give you the best possible website experience. By using WebDevelopersNotes.com, you agree to our Privacy Policy