Prakriti Shaurya
Prakriti Shaurya

Reputation: 197

How to resolve "access denied for user 'root'@'localhost' in mysql workbench windows"

I have tried starting the mysql server but unanle to do so. I have changed the password which I am using while connecting to database, other things(hostname, port and username) remained same.

I have already checked mysql service in taskmanager, tried starting from command line and from mysql shell but still not able to succees.

C:\Program Files\MySQL\mysql-8.0.21-winx64\mysql-8.0.21-winx64\bin>mysql -u root -p Enter password: ************** ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

C:\Program Files\MySQL\mysql-8.0.21-winx64\mysql-8.0.21-winx64\bin>mysql start ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)

Any help would be greatly appreciated.

Please find below the screenshots of the error.

cmd_error

taskmanager

workbench1

workbench2

Upvotes: 1

Views: 19584

Answers (4)

juke box
juke box

Reputation: 11

  1. Go to C:/XAMPP/mysql/bin/

  2. open my.ini (configuration setting type file)

  3. under # The mysql server [mysqld] add a new line just after above heading and write skip-grant-tables enter image description here

  4. ctrl+s (save)

  5. open XAMPP control panel and click stop if your mysql server is already running and then click start again basically we are restarting the server and boom your problem is solved open workbench and try again to create a new connection.

Upvotes: 0

Gabrielly de Andrade
Gabrielly de Andrade

Reputation: 91

I was facing the same error. I could connect using terminal but not using workbench.

I follow these steps and it worked for me: https://phoenixnap.com/kb/access-denied-for-user-root-localhost

I run this command:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'insert_password';

and then it was possible to access without admin privileges.

Upvotes: 8

Prakriti Shaurya
Prakriti Shaurya

Reputation: 197

Everytime I open the mysql workbench, I see the access denied error 'root'@'localhost'. The below resolution works for me:

  1. Open taskmanager
  2. Go to service tab
  3. Open services
  4. For me, two services run MySQL and MySQL80.
  5. I stop the MySQL service and start the MySQL80 service.
  6. This resolves my issue.

Upvotes: 2

Prakriti Shaurya
Prakriti Shaurya

Reputation: 197

After some google search, I found that there were two services MySQL and MySQL80 running in the services tab of task manager. I stopped the MySQL and started the MySQL80 service. This resolved my issue.

Upvotes: 0

Related Questions