MariaDB 警告:'root@localhost' 两者都有...密码将被忽略 [英] MariaDB Warning: 'root@localhost' has both ... The password will be ignored

查看:40
本文介绍了MariaDB 警告:'root@localhost' 两者都有...密码将被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在 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 访问数据库可以正常工作.但是使用 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.

问题是:

  1. 这是担心还是完全正常?
  2. 如果担心,我该如何解决?

推荐答案

正常,如果说通过mysql -u root -p访问数据库正常"em> 你的意思是你在作为系统根目录(或在 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;

您应该在 root@localhostplugin 列中看到 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆