命令基本格式為:influx -database 'database_name' -execute 'SELECT * FROM table_name' -format csv >> test.csv
實際操作舉例,數據庫為:ceshi 表名為:lianxi
1、當無密碼時,且在本機上執行導出時,命令為:
influx -database ceshi -execute 'SELECT * FROM lianxi ' -format csv >> test.csv
2、當有密碼,在本機上或者遠程執行導出時,命令為:以influx使用的8086端口舉例
influx -host x.x.x.x -port 8086 -database ceshi -username 'user' -password 'mima' -execute 'SELECT * FROM lianxi ' -format csv >> test.csv
3、當有密碼,在本機上或者遠程執行導出指定時間范圍內的數據時,命令為:以influx使用的8086端口舉例
influx -host x.x.x.x -port 8086 -database ceshi -username 'user' -password 'mima' -execute 'SELECT * FROM lianxi where time>=1593592487000000000 and time<1593593393000000000' -format csv >> test.csv