MariaDB 警告:'root@localhost' 两者都有...密码将被忽略

MariaDB Warning: #39;root@localhost#39; has both ... The password will be ignored(MariaDB 警告:root@localhost 两者都有...密码将被忽略)
本文介绍了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' 两者都有...密码将被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Hibernate reactive No Vert.x context active in aws rds(AWS RDS中的休眠反应性非Vert.x上下文处于活动状态)
Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
Flask + PyMySQL giving error no attribute #39;settimeout#39;(FlASK+PyMySQL给出错误,没有属性#39;setTimeout#39;)
auto_increment column for a group of rows?(一组行的AUTO_INCREMENT列?)
Sort by ID DESC(按ID代码排序)
SQL/MySQL: split a quantity value into multiple rows by date(SQL/MySQL:按日期将数量值拆分为多行)