您正在以匿名用户身份使用 mariadb

You are using mariadb as an anonymous user(您正在以匿名用户身份使用 mariadb)
本文介绍了您正在以匿名用户身份使用 mariadb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有权限都被拒绝,我所有的数据库似乎都被删除了.当我尝试更改密码时,我收到主题中提到的错误.最初没有设置密码,执行以下命令后开始出现此行为

All the privileges have been denied and all my databases seem to have been deleted. I get the error mentioned in the subject when I try to change the password. Initially there was no password set and this behaviour started after executing the following command

update mysql.user set password=password('newpass') where user='root';

我输入mysql使用:

I enter mysql using:

mysql -u root

我尝试执行的每个命令都会出现访问被拒绝错误.我尝试在 google 上冲浪,但没有找到解决问题的方法.

Every command I try to execute gives me access denied error. I tried surfing on google but did not get a solution to solve the issue.

推荐答案

还要设置用户的插件,每次刷新权限

You must set the plugin of the user too, and flush privileges everytime

> update mysql.user set password=password('newpass') where user='root';
> flush privileges;
> update mysql.user set plugin='mysql_native_password' where user='root';
> flush privileges;

然后在数据库实例启动时检查您是否使用匿名用户:在您的 /etc/my.cnf 中删除/注释任何看起来像这样的行

Then check you are not using an anonymous user when the database instance starts: in your /etc/my.cnf remove/comment any line which looks like this

skip-grant-tables #comment with #

然后重启数据库

service <db> restart

这篇关于您正在以匿名用户身份使用 mariadb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

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

相关文档推荐

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:按日期将数量值拆分为多行)