MariaDB Warning: 'root@localhost' has both … The password will be ignored

天大地大妈咪最大 提交于 2019-12-05 20:27:21

问题


I have installed MariaDB on Ubuntu LTS 16.04. Then I have run

/usr/bin/mysql_secure_installation

and set a root password. Accessing the DB via mysql -u root -p works fine. But checking the status with service mysql status opens a log file with this warning:

[Warning] 'user' entry 'root@localhost' has both a password and an authentication plugin specified. The password will be ignored.

The questions are:

  1. Is this a worry or completely normal?
  2. If this is a worry, how can I fix it?

回答1:


It is normal, if by saying "accessing the DB via mysql -u root -p works fine" you mean that you are running it while being a system root (or under sudo). You should not be able to do it as an ordinary user.

Packages generated by Ubuntu by default have unix_socket authentication for the local root. To check, run

SELECT user, host, plugin FROM mysql.user;

You should see unix_socket in the plugin column for root@localhost.

If you want to use the password authentication instead, run

UPDATE mysql.user SET plugin = '' WHERE plugin = 'unix_socket';
FLUSH PRIVILEGES;


来源:https://stackoverflow.com/questions/43439111/mariadb-warning-rootlocalhost-has-both-the-password-will-be-ignored

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!