本文介紹不同的自建數據庫引擎在為數據庫自治服務DAS授權賬號時,需要具備的最小權限;如果不滿足最小權限,DAS的連通測試將返回權限不足。
說明
本文以賬號名為das_test
,密碼為password
進行舉例說明,請根據實際情況進行替換。
自建MySQL
創建賬號并授權:
CREATE USER 'das_test'@'%' IDENTIFIED BY 'password';
GRANT SHOW DATABASES, PROCESS, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'das_test'@'%';
GRANT SELECT ON *.* TO 'das_test'@'%';
自建PostgreSQL
創建賬號并授權:
CREATE USER das_test PASSWORD 'password';
GRANT SELECT ON ALL TABLES IN SCHEMA PUBLIC TO das_test;
/* 可選執行,用于采集慢日志和SQL */
ALTER USER das_test WITH SUPERUSER;
自建MongoDB
創建賬號并授權:
use admin;
db.createUser({user:'das_test',pwd:'password',roles:[{role:'readAnyDatabase', db:'admin'}, {role:'clusterMonitor', db:'admin'}, {role: 'hostManager', db: 'admin'},{db: 'local', role: 'dbAdmin'},{db: 'config', role: 'dbAdmin'},{db: 'admin', role: 'dbAdminAnyDatabase'}]});
文檔內容是否對您有幫助?