MySQL fails on: mysql “ERROR 1524 (HY000): Plugin 'auth_socket' is not loaded”

前端 未结 9 1550
广开言路
广开言路 2020-11-28 00:21

My local environment is:

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

    sudo apt-get install mysql-common mysql-se         
    
    
            
相关标签:
9条回答
  • 2020-11-28 01:18

    For Ubuntu 18.04 and mysql 5.7

    • step 1: sudo mkdir /var/run/mysqld;

      step 2: sudo chown mysql /var/run/mysqld

      step 3: sudo mysqld_safe --skip-grant-tables & quit (use quit if its stuck )

    login to mysql without password

    • step 4: sudo mysql --user=root mysql

      step 5: SELECT user,authentication_string,plugin,host FROM mysql.user;

      step 6: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'

    now login with

    • mysql -u root -p <root>
    0 讨论(0)
  • 2020-11-28 01:21

    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.
    
    0 讨论(0)
  • 2020-11-28 01:22

    I tried with and it works

    use mysql; # use mysql table
    update user set authentication_string="" where User='root'; 
    
    flush privileges;
    quit;
    
    0 讨论(0)
提交回复
热议问题