• Register
0 votes
618 views

Problem :

Whenever I want to open a mysql in my windows cmd by simply typing mysql. I am facing below error :

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

After that by looking at similar queries I somehow got the temporary solution by using the C:> mysql -u root -p and then typing the required password, then  mysql is working. But when I close and reopen it, the same problem is happening.

One more issue is that I have created the user 'admin'. but when I am trying to open the mysql using the command as below :

 

C:> mysql --user=admin --password=root,

 

The following error is showing up again :

 

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

 

Any pointers will be the great help.

6 5 3
7,540 points

2 Answers

0 votes

Solution :

Because of some critical reasons a ODBC username is always a default username under a windows even if you did not create a user at a setup time. By simply typing below :

mysql

Without specifying the username will attempt to connect it with the non-existent ODBC username, and it will give below error:

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

 

Instead of that please try specifying the username that you know, for example as below:

mysql -u root -p

 

Where the -u root is specifing your username root and the -p will make above command to prompt for your password.

9 7 4
38,600 points
0 votes

The user cannot log in to the MYSQL server with a simple mysql command at the prompt. This is a very minor issue and can be solved quickly by using the correct MYSQL login command at the terminal window.

Login using the command-line client:

The MYSQL packages come with the Command-Line Client 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.

The MYSQL command Line Client can be launched by the following method;

  • Go to All Programs.
  • Go to MYSQL.
  • Then Go to MYSQL Server 5.1.
  • After that click on the MYSQL Command Line Client.
  • The user can also load it from the terminal window, but simply typing mysql followed by the “Enter” key at the DOS prompt window will throw the above error.

Solution:

To login successfully you have to provide the password. For instance, if you launch the MYSQL Command Line Client, it waits for the user to type in the password.

A simple “mysql” command is insufficient for logging in at MYSQL. The user need to use;

 mysql –u root –p

Here root is the user name and can be changed if your logging in information is different. The program now waits for the password which was set up when MYSQL was installed on the Windows computer.

 

11 5 1
3,890 points

Related questions

0 votes
1 answer 62 views
0 votes
2 answers 2.9K views
2.9K views
Problem : I keep getting a below error with mysql connection through a XAMPP and I really don't know what to do: “Mysqli_real_connect(): (hy000/1045): access denied for user 'pma'@'localhost' (using password: no)” I have already reset my password from a MySql from a ... a changes to my code and to my php.ini file, but at each time it goes back to a error. Any help on this issue?
asked Jan 31 jwilliam 3.9k points
0 votes
1 answer 71 views
71 views
Problem : I am new to MySql. The problem started when I was unable to login to Mysql using my Mysql console. It is repeatedly asking me the password and now I am unable to remember my password. Can I change my password ? And now when I am trying to open my PhpMyAdmin ... WAMP and after that deleted all my related files and then reinstalled it .But it did not fix my issue. How can I fix the issue ?
asked Feb 26 mphil 2.3k points
0 votes
1 answer 1.2K views
1.2K views
Problem : I am new to NodeJS and trying to connect to mySQL through the NodeJS file, however I am facing the below error : { Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password: YES) at Handshake.Sequence._packetToError (/home/alecxe/Node ... bar" AS second_field', function(err, results, fields) { console.log(err); console.log(results); myconnection.end(); } );
asked Dec 6, 2019 alecxe 7.5k points