02-influxdb的权限管理-创新互联

  • 01-InfluxDB介绍请添加链接描述

    成都创新互联公司IDC提供业务:BGP机房服务器托管,成都服务器租用,BGP机房服务器托管,重庆服务器租用等四川省内主机托管与主机租用业务;数据中心含:双线机房,BGP机房,电信机房,移动机房,联通机房。
  • 02-influxdb的权限管理

  • 03-Influxdb的备份与恢复

介绍

其实influxdb的权限语法和mysql基本相似,看完以后你基本就能了解;

授权语法

  1. 创建用户:CREATE USER WITH PASSWORD ''
  2. 授权权限:GRANT [READ,WRITE,ALL] ON TO
  3. 创建并授权:CREATE USER WITH PASSWORD '' WITH ALL PRIVILEGES
  4. 取消授权:REVOKE ALL PRIVILEGES FROM
  5. 修改密码:SET PASSWORD FOR = ''
  6. 删除用户:DROP USER

开启登录认证
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 ".
> auth
username: monitor
password:
> show databases
name: databases
name
----
_internal
zabbix
telegraf
chronograf
> quit

授权操作

1.创建超级用户
创建用户:monitor
密码:zabbix
权限:全部权限(超级用户)
create user monitor with password 'zabbix' with all privileges

2.创建只读用户
用户:monitor_ro
数据库:monitordb
权限:指定数据库的只读权限

create user monitor_ro with password 'zabbix_apipwd'
grant read on monitordb to monitor_ro

3.创建可以写用户
用户:monitor_rw
数据库:monitordb
权限:指定数据库的写权限

create user monitor_rw with password 'zabbix_apipwd'
grant write on monitordb to monitor_rw

4.取消用户授权
取消用户授权:

REVOKE ALL PRIVILEGES FROM monitor_rw

5.查看所有用户

SHOW USERS
user admin


monitor true
monitor_ro false
monitor_rw false

6.删除用户

DROP USER monitor_rw

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


分享题目:02-influxdb的权限管理-创新互联
文章URL:http://myzitong.com/article/gidsh.html