MariaDB警告:'root @ localhost'同时存在...密码将被忽略 [英] MariaDB Warning: 'root@localhost' has both ... The password will be ignored
问题描述
我已经在Ubuntu LTS 16.04上安装了MariaDB.那我就跑了
I have installed MariaDB on Ubuntu LTS 16.04. Then I have run
/usr/bin/mysql_secure_installation
并设置root密码.通过mysql -u root -p
访问DB可以正常工作.但是使用service mysql status
检查状态会打开一个带有以下警告的日志文件:
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.
问题是:
- 这是担心还是完全正常?
- 如果担心的话,我该如何解决?
推荐答案
这很正常,如果说通过mysql -u root -p
访问DB可以正常工作" ,则表示您正在运行它是系统根目录(或在sudo
下).您不应该以普通用户的身份来做.
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.
Ubuntu默认生成的软件包对本地的 unix_socket 身份验证根.要检查,请运行
Packages generated by Ubuntu by default have unix_socket authentication for the local root. To check, run
SELECT user, host, plugin FROM mysql.user;
您应该在plugin
列的plugin
列中看到unix_socket
.
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;
这篇关于MariaDB警告:'root @ localhost'同时存在...密码将被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!