Show all available databasesshow databases
Use a database e.g mydbuse mydb
Show available fields and their type of a a databaseshow field keys
Show series where xyzshow series where "powermeter" = 'xyzzz'
Calculate difference between the two latest values of two daysSELECT difference(last(total_kWh)) FROM power_total WHERE time >0 AND "powerMeter" = 'xyz' GROUP BY time(1d)
Select the latest entries from a field within a timespan of 2 daysselect * from inputs WHERE time >= now() -2d
select * from inputs WHERE time >= now - 10m
Write measurement / series in database. Select database first. Tag Keys are not requiredINSERT TheMeasurement value=10
Select last 10 entriesSELECT * FROM measurement ORDER BY desc LIMIT 10
Rename measurement. Not supported by influx. Copy into a new one is they way. To preserve tags, use group by *SELECT * INTO DestMeasurementCopy from SrcMeasurement GROUP BY *
DROP MEASUREMENT SrcMeasurement
Drop a measurementDROP MEASUREMENT measurement_name
Grant user all rights on databaseGRANT ALL ON "powermeter" to "myUser"
Grant user read rights on databaseGRANT READ ON "powermeter" to "myGrafanaUser"
Show rights of a userSHOW GRANTS for myUser
Create user with passwordCREATE USER "myUser" WITH PASSWORD thepassword
Create user with all privilegesCREATE USER admin WITH PASSWORD mypw WITH ALL PRIVILEGES
Show all usersSHOW USERS
Create a databaseCREATE DATABASE powermeter
Delete databaseDROP DATABASE myDatabase
Schreibe einen Kommentar