• Register
0 votes
923 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

Please log in or register to answer this question.

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 2
3,890 points

Related questions

0 votes
1 answer 90 views
0 votes
1 answer 96 views
0 votes
1 answer 92 views
92 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, 2020 mphil 2.3k points
0 votes
1 answer 1.5K views
1.5K 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
0 votes
2 answers 4.1K views
4.1K 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, 2020 jwilliam 3.9k points
0 votes
1 answer 36 views
0 votes
1 answer 46 views
46 views
Problem: I had installed MySQL on my linux server sometimes back now I forgot the password so I tried to change it using the ways I found online. What I did was as shown below: /etc/init.d/mysql stop mysqld_safe --skip-grant-tables & mysql --user root mysql SELECT * ... it still shows me below errors  "Access denied for user 'root'@'localhost' (using password: Yes)". How to fix above MYSql error?
asked Jul 14, 2020 Raphael Pacheco 4.9k points
1 vote
1 answer 571 views
571 views
Problem : I am naïve to mysql. Currently I am continuously facing below error. “Mysql access denied for user 'root'@'localhost' (using password yes)”. I have recently started using mySQL Workbench and after doing research on above error I found that my root's ... of no us. I want to get my root access back as soon as possible. Can somebody help me in getting my root access back?
asked Apr 7, 2020 morrisBson 3.2k points