mariadb登陆报错: 1698 - Access denied for user

当尝试使用 Navicat for MariaDB 登录时,出现 'Access denied for user' 错误,原因是 root 用户仅允许通过本地 Unix 套接字登录。解决方法包括在 mysql.user 表中更改 root 用户的 plugin 字段或创建新用户。当 plugin 字段为空时,MariaDB 使用默认的密码验证插件进行身份验证。
摘要由CSDN通过智能技术生成

通过shell终端中可以免密码登陆mysql -uroot,但是使用navicat for mariadb登陆报错:1698 - Access denied for user 'root'@'localhost'

Server version: 10.1.38-MariaDB-0+deb9u1 Debian 9.8

MariaDB [mysql]> select user,host,plugin from user where user='root'\G;
*************************** 1. row ***************************
  user: root
  host: %
plugin: unix_socket
1 row in set (0.00 sec)

可以看到root仅仅允许本地unix socket登陆。

关于unix_socket的介绍:

The unix_socket authentication plugin allows the user to use operating system credentials when connecting to MariaDB via the local Unix socket file. This Unix socket file is defined by the socket system variable.
The unix_socket authentication plugin works by calling the getsockopt system call with the SO_PEERCRED socket option, which allows it to retrieve the uid of the proces

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值