一、Influxdb下载

本文中使用的环境是centos7.3

  wget https://dl.influxdata.com/influxdb/releases/influxdb-1.7.6.x86_64.rpm

二、安装Influxdb

[root@salt influxdb]# yum -y localinstall influxdb-1.7.6.x86_64.rpm

三、启动influxdb

[root@salt ~]# systemctl  start influxdb
[root@salt ~]# netstat -antp |grep influx
tcp 0 0 127.0.0.1:8088 0.0.0.0:* LISTEN 59856/influxd
tcp 0 0 192.168.100.94:41780 99.84.55.125:443 ESTABLISHED 59856/influxd
tcp6 0 0 :::8086 :::* LISTEN 59856/influxd

四、influxdb的权限配置

1.登录influxdb数据库

[root@salt ~]# influx
Connected to http://localhost:8086 version 1.7.6
InfluxDB shell version: 1.7.6
Enter an InfluxQL query
>

我们安装完毕后,默认是没有启用认证功能,所有可以直接登录

2.授权用户登录

创建一个管理员用户,并且给了所有权限(也就是rw)

> create user zhangsan with password '123' with all privileges;

查看是否创建成功,这里创建成功,并且是管理员

> show users;
user admin
---- -----
zhangsan true

3.开启用户授权

[root@salt ~]# vim /etc/influxdb/influxdb.conf
[http]
auth-enabled = true #将flase改为true

4.重启服务

[root@salt ~]# systemctl  restart influxd

5.登录验证

[root@salt ~]# influx
Connected to http://localhost:8086 version 1.7.6
InfluxDB shell version: 1.7.6
Enter an InfluxQL query
> show users;
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>".

失败,没有权限查看了

6.使用授权用户登录

[root@salt ~]# influx -username zhangsan -password '123'
Connected to http://localhost:8086 version 1.7.6
InfluxDB shell version: 1.7.6
Enter an InfluxQL query
>
> show users;
user admin
---- -----
zhangsan true

能够正常登录并且有权限查看相关内容

五、增删查

Influxdb和mysql的结构一样,只是关键字不同

mysql influxdb 单位
databaase database 数据库
table measurement
record point 一行记录

Point由时间戳(time)、数据(field)、标签(tags)组成。

1.创建数据库

#创建数据库
> create database t1; #查看已经创建的数据库
> show databases;
name: databases
name
----
_internal
t1

2.删除数据库

> drop database t1;
> show databases;
name: databases
name
----
_internal

3.创建表(measurement)

注意点:

measurement不用单独创建,在第一次插入数据的时候会自动创建

measurement中没有数据,表也就不存在了

measurement没有update语句,无法修改measurement中的内容,只能删除某一条,在重新插入

最新文章

  1. CSS3与页面布局学习笔记(一)——概要、选择器、特殊性与刻度单位
  2. HDU 5920 Ugly Problem 高精度减法大模拟 ---2016CCPC长春区域现场赛
  3. 自定义异常时如何定义checked异常和unchecked异常
  4. [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server 不存在或访问被拒绝
  5. 权限执行[Android开发常见问题-4] RunTime.exec()如何以root权限执行多条指令?
  6. (转)FastDFS_v5.05安装配置
  7. WebSocket 简介
  8. Cocos2d-x--Box2D使用GLES-Render.h渲染查看刚体
  9. javase
  10. Linux环境下Android JNI程序的编译
  11. 74、django之ajax补充
  12. Linuxc - gdb调试程序
  13. Visual Studio 2012 和 SVN 结合实现版本控制 AnkhSvn
  14. ORM简介
  15. Multi-View 3D Reconstruction with Geometry and Shading——Part-1
  16. Docker部署SonarQube
  17. [No0000E7]C# 封装 与访问修饰符
  18. MySQL语法和用户授权
  19. DataGrip设置长sql语句自动换行
  20. VMWare Workstation 11的安装

热门文章

  1. zabbix实现对主机和Tomcat监控
  2. Does compiler create default constructor when we write our own?
  3. eclips 配置一个tomcat,启动多个不同端口的web项目
  4. 什么是mysql innodb cluster?
  5. Python 的切片为什么不会索引越界?
  6. Java网络多线程开发:java.io.EOFException
  7. CF977B Two-gram 题解
  8. 【LeetCode】750. Number Of Corner Rectangles 解题报告 (C++)
  9. 【LeetCode】264. Ugly Number II 解题报告(Java & Python)
  10. 【LeetCode】734. Sentence Similarity 解题报告(C++)