Wednesday, October 20, 2021

Failed to connect to MySQL at with user root

When users connecting to MySQL using Workbench or from command prompt they may receive the error when they don’t have access to connect from the machine.

It is mainly due to security setup that allows to connect to “root” from specific IP address or localhost

In this scenario, ask your admins to create a new user account and setup the required access instead of using “root”

If the root account is not configure to authenticate with a password, you may need below command

MySQL> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

If user need to login as root, you they can follow the steps to grant access to local host and or IP Address

MySQL> GRANT ALL ON [DB_Name].* to 'root'@ ‘IP Address’ IDENTIFIED BY '[PASSWORD]';

Instead of using “GRANT ALL ON”, use required privileges only.

Thanks & Regards, Oracle ACE


  1. Love to read it, waiting for More New Update and I Already Read your Recent Post it's Great. Thank you for sharing useful information. If you like to Know Azerbaijan Medical Journal Visit our website for More Medical Science Information.

  2. Bihar School Examination Board is a governing body in Bihar that oversees The BSEB is a public and government board. It was established with the goal of providing the greatest education in the state of Bihar. A considerable number of public and private schools are linked with the board. Every school and institution adheres to the regulations and materials established by the board. Bihar 9th Weightage 2023 All facts, such as the Bihar Board Class 9th Blueprint 2023, are submitted to the board on a regular basis. When the board releases the Bihar Board Class 9th Blueprint 2023, we will update this page with a link to the Bihar Board Class 9th Blueprint 2023.The Blueprint for the Bihar Board's Class 9th Class Examinations in 2023.