Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to overcome ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO) permanently

Tags:

mysql

when am trying to open mysql in windows cmd by typing mysql. the following error is occuring.

ERROR 1045 (28000): Access denied for user ODBC@localhost (using password: NO)

And then by looking similar queries i somehow got a temporary solution by using C:> mysql -u root -p and then typing the password, mysql is working. But when i close and open, the same problem is recurring.

One more thing is that i have created a user 'admin'. but when am trying to open mysql using the command C:> mysql --user=admin --password=root, the following error is occuring:

C:\Users\abhay kumar>mysql --user=admin --password=root
ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password:NO)

Any help will great

like image 663
user3690599 Avatar asked May 30 '14 09:05

user3690599


3 Answers

for some reason, the ODBC user is the default username under windows even if you didn't create that user at setup time. simply typing

mysql

without specifying a username will attempt to connect with the non-existent ODBC username, and give:

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

Instead, try specifying a username that you know, for example:

mysql -u root -p

where -u root specified the username root and -p will make the command prompt for a password.

like image 107
Nish Avatar answered Oct 08 '22 03:10

Nish


You need to create an user "ODBC" for MySql with no password. Do that in PHPMyAdmin. That will solve your problem.

But remember, if it's only your local development environment, no problem. It'll create a serious security hole in your production environment.

User ODBC with no password

Problem Solved

like image 27
Imtiaz Avatar answered Oct 08 '22 01:10

Imtiaz


I tried this and it worked:

C:\cd MySQL installed path\MySQL -uyourusername -pyourpassword
like image 2
ravi ranjan Avatar answered Oct 08 '22 01:10

ravi ranjan