MariaDB Warning: #39;root@localhost#39; has both ... The password will be ignored(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.
问题是:
- 这是担心还是完全正常?
- 如果担心,我该如何解决?
推荐答案
正常,如果说通过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@localhost
的 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' 两者都有...密码将被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:MariaDB 警告:'root@localhost' 两者都有...密码将被忽略


基础教程推荐
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- SQL Server 2016更改对象所有者 2022-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01