Mysql (MariaDB 10.0.29): Set root password, but still can login without asking password?

后端 未结 3 1871
感情败类
感情败类 2021-01-31 16:44

I want to secure mysql by setting root password. I reset root password successfully:

MariaDB [(none)]> select Host, User, Password from mysql.user;
+---------         


        
3条回答
  •  抹茶落季
    2021-01-31 16:53

    I found I needed to change this:

    UPDATE mysql.user SET plugin = 'auth_socket' WHERE user = 'root' AND host = 'localhost';
    

    To

     UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE user = 'root' AND host = 'localhost';
    

    That is the plugin for a password AFAICT.

提交回复
热议问题