【问题标题】:How to grant root user all privileges while skip-grant-table is enabled如何在启用 skip-grant-table 时授予 root 用户所有权限
【发布时间】:2022-01-18 13:42:32
【问题描述】:

我想在启用skip-grant-tables 时将所有权限授予mysql 数据库中的root 用户。

我该怎么做?

当我禁用skip-grant-tables 选项时,由于此错误,我无法登录mysql

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

当我运行这个命令时,它会影响零行:

GRANT ALL PRIVILEGES ON  *.* TO 'root'@'localhost';

还有:

FLUSH PRIVILEGES;

不会刷新或改变任何东西。

数据库是 Mariadb 版本 10.3.22。

【问题讨论】:

    标签: mysql mariadb


    【解决方案1】:

    设置 1:启用跳过授权表时

    更新用户集 authentication_string=password("root") where user="root";
    刷新权限;

    设置 2:
    删除 my.cnf 中的 skip-grant-tables

    设置 3:
    重启mysql服务

    【讨论】:

    • 然后授予root权限;
    • 我不能update,因为在启用skip-grant 时它不起作用。
    猜你喜欢
    • 2018-10-15
    • 1970-01-01
    • 1970-01-01
    • 2020-08-08
    • 2012-01-19
    • 2020-11-22
    相关资源
    最近更新 更多