MySQL fails on: mysql “ERROR 1524 (HY000): Plugin

2020-01-25 03:32发布

My local environment is:

  • fresh Ubuntu 16.04
  • with PHP 7
  • with installed MySQL 5.7

    sudo apt-get install mysql-common mysql-server
    

When I tried to login to MySQL (via CLI):

mysql -u root -p

I came across an cyclic issue with 3 steps.

1) First was some socket issue

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

Solution: restarting PC.

Which led to another error:

2) With access denied

ERROR 1698 (28000): Access denied for user 'root'@'localhost'.

Possible issue? Wrong password for "root" user!

Solution: reset root password with this tutorial.

With correct password and working socket, there comes last error.

3) Incorrect auth plugin

mysql "ERROR 1524 (HY000): Plugin 'unix_socket' is not loaded"

Here I stopped or somehow got to 1) again.

8条回答
劳资没心,怎么记你
2楼-- · 2020-01-25 03:59

Try it: sudo mysql_secure_installation

Work's in Ubuntu 18.04

查看更多
做个烂人
3楼-- · 2020-01-25 03:59

You can try with the below commands:

hduser@master:~$ sudo /etc/init.d/mysql stop
[ ok ] Stopping mysql (via systemctl): mysql.service.
hduser@master:~$ sudo /etc/init.d/mysql start
[ ok ] Starting mysql (via systemctl): mysql.service.
查看更多
登录 后发表回答