您好,登錄后才能下訂單哦!
01-InfluxDB介紹請?zhí)砑渔溄用枋?/p>
02-influxdb的權(quán)限管理
其實influxdb的權(quán)限語法和mysql基本相似,看完以后你基本就能了解;
授權(quán)語法
開啟登錄認證
vim /etc/influxdb/influxdb.conf
[http]
auth-enabled = true
[root@localhost tmp]# influx
Connected to http://localhost:8086 version 1.7.1
InfluxDB shell version: 1.7.1
Enter an InfluxQL query
> show databases
ERR: unable to parse authentication credentials
Warning: It is possible this error is due to not setting a database.
Please set a database with the command "use <database>".
> auth
username: monitor
password:
> show databases
name: databases
name
----
_internal
zabbix
telegraf
chronograf
> quit
1.創(chuàng)建超級用戶
創(chuàng)建用戶:monitor
密碼:zabbix
權(quán)限:全部權(quán)限(超級用戶)
create user monitor with password 'zabbix' with all privileges
2.創(chuàng)建只讀用戶
用戶:monitor_ro
數(shù)據(jù)庫:monitordb
權(quán)限:指定數(shù)據(jù)庫的只讀權(quán)限
create user monitor_ro with password 'zabbix_apipwd'
grant read on monitordb to monitor_ro
3.創(chuàng)建可以寫用戶
用戶:monitor_rw
數(shù)據(jù)庫:monitordb
權(quán)限:指定數(shù)據(jù)庫的寫權(quán)限
create user monitor_rw with password 'zabbix_apipwd'
grant write on monitordb to monitor_rw
4.取消用戶授權(quán)
取消用戶授權(quán):
REVOKE ALL PRIVILEGES FROM monitor_rw
5.查看所有用戶
SHOW USERS
user admin
monitor true
monitor_ro false
monitor_rw false
6.刪除用戶
DROP USER monitor_rw
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。