博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux普通用户无法登录mysql——ERROR 1698 (28000): Access denied for user 'root'@'localhost'
阅读量:2395 次
发布时间:2019-05-10

本文共 848 字,大约阅读时间需要 2 分钟。

现场还原:用root用户在Linux上安装mysql后,用Linux的root用户可以登录mysql,但普通用户无法登录,提示错误:ERROR 1698 (28000): Access denied for user 'root'@'localhost'

一、mysql用root登录mysql

选择以mysql命名的数据库,用以下命令查看user表:

select host,user,plugin from user;

结果如下:

+-----------+---------+-----------------------+| host | user | plugin |+-----------+---------+-----------------------+| localhost | root | unix_socket |+-----------+---------+-----------------------+

二、修改plugin属性为mysql_native_password

update user set authentication_string=PASSWORD('000000'), plugin='mysql_native_password' where user='root';

结果如下:

+-----------+---------+-----------------------+| host | user | plugin |+-----------+---------+-----------------------+| localhost | root | mysql_native_password |+-----------+---------+-----------------------+

三、重启mysql服务

service mysql stop
service mysql start

四、在普通用户下用root账号登录成功!

 

转载地址:http://tuzob.baihongyu.com/

你可能感兴趣的文章
windows7配置虚拟AP的脚本
查看>>
北京开放政府信息资源 “大数据”供社会化利用
查看>>
大数据挖掘变革 美赛达软硬云引领车联网商业蓝海
查看>>
停车费上涨需要公开“大数据”
查看>>
DirectFB代码导读
查看>>
Cocos2dx3.2从零开始【四】继续。
查看>>
sphinx教程2__安装、配置和使用
查看>>
《云计算架构技术与实践》序言(李德毅院士)
查看>>
SANS FOR572 Logstash
查看>>
FreeBSD kernel NFS client local vulnerabilities
查看>>
Flash Builder 4字体设置
查看>>
OpenGL坐标系
查看>>
VS2008快捷键大全
查看>>
数据库服务器 Cloudscape
查看>>
Apache Cayenne—辣椒你吃了吗?
查看>>
云应用开发工具:Spring Cloud 1.0 正式发布
查看>>
Installing Kubernetes on Linux with kubeadm
查看>>
分布式存储系统GlusterFS初体验
查看>>
GlusterFS常用命令小结
查看>>
Using Gluster for a Distributed Docker Storage Volume
查看>>