簡體   English   中英

如何在啟用 skip-grant-table 時授予 root 用戶所有權限

[英]How to grant root user all privileges while skip-grant-table is enabled

我想在啟用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。

設置 1:啟用跳過授權表時

更新用戶集 authentication_string=password("root") where user="root";
刷新特權;

設置2:
刪除 my.cnf 中的 skip-grant-tables

設置 3:
重啟 mysql 服務

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM