首页 > 解决方案 > 我不小心更改了我的root权限,如何解决?

问题描述

所以我不小心改变了我的root用户的权限,我现在什么也做不了数据库是隐藏的,因为没有全局权限,

已经尝试更改 [mysqld] 中的某些行并添加

skip-grant-tables

在 my.ini 中,但它不能再次将特权更改为正常,只是说

ERROR 1290 (HY000): The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement

我的问题有什么解决方案吗?

标签: mysqlxampp

解决方案


我希望正如您所说,您已经尝试过 --skip-grant-tables 选项。您已完成以下所有步骤: 1.停止 mysqld 并使用 --skip-grant-tables 选项重新启动它。2.连接到mysqld服务器只需要:mysql(即没有-p选项,可能不需要用户名)。3.在mysql客户端发出以下命令:

UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root';

同花顺特权;

4.之后,您应该能够运行 GRANT ALL ON TO 'root'@'localhost'; 让它工作。

如果这不起作用,您可以在 Ubuntu 16.04 上使用 debian-sys-maint 用户来恢复 user.root 权限。您可以从此文件中找到 user.debian-sys-maint 的密码

sudo cat /etc/mysql/debian.cnf

推荐阅读