'Plugin 'root' is not loaded

I am trying to create a new user but whenever i launch the mysql shell and enter it as the root user using the command

mysql -u root -p

I get an error saying

ERROR 1524 (HY000): Plugin 'root' is not loaded


Solution 1:[1]

I solved my problem by adding a new user. step 1 to 3 might not be useful for all.

  1. $ sudo mkdir -p /var/run/mysqld;
  2. $ sudo chown mysql /var/run/mysqld;
  3. $ sudo mysqld_safe --skip-grant-tables &
  4. $ mysql -uroot # "-hlocalhost" is default
  5. try one of these (a) $ sudo mysql -u root -p;
    or
    (b) $ sudo mysql -u root;
  6. use mysql;
  7. CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'mypass';

if USER is already present delete it using -

DROP USER 'test'@'localhost';

this will create a new user . or you can modify the password for the same user. Option 4 and 5 will help to get you to mysql terminal, once you got there you can solve your issue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 kunal