# README
Insert data into GreptimeDB
Insert
go run main.go
Output:
2024/11/13 19:15:23 affected rows: 4
2024/11/13 19:15:23 affected rows: 4
2024/11/13 19:15:23 affected rows: 1
2024/11/13 19:15:23 affected rows: 4
2024/11/13 19:15:23 affected rows: 4
2024/11/13 19:15:23 affected rows: 1
Query
Your can using MySQL Client to query the data from GreptimeDB.
$ mysql -h 127.0.0.1 -P 4002
mysql> select * from monitors_with_tag;
+------+-----------+--------+------+-------------+---------+----------------------------+
| id | host | memory | cpu | temperature | running | ts |
+------+-----------+--------+------+-------------+---------+----------------------------+
| 0 | 127.0.0.1 | 1 | 1.3 | -1 | 0 | 2024-11-13 11:15:23.420000 |
| 0 | 127.0.0.1 | 1 | 1.3 | -1 | 0 | 2024-11-13 11:15:23.637000 |
| 1 | 127.0.0.2 | 1 | 1.1 | -1 | 1 | 2024-11-13 11:15:23.420000 |
| 1 | 127.0.0.2 | 1 | 1.1 | -1 | 1 | 2024-11-13 11:15:23.637000 |
| 2 | 127.0.0.3 | 2 | 2 | -2 | 1 | 2024-11-13 11:15:23.420000 |
| 2 | 127.0.0.3 | 2 | 2 | -2 | 1 | 2024-11-13 11:15:23.637000 |
+------+-----------+--------+------+-------------+---------+----------------------------+
6 rows in set (0.07 sec)