[英]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.