This commit is contained in:
Hui Li 2020-06-04 18:38:17 +08:00
parent f7a1827341
commit 26b5944b40
1 changed files with 5 additions and 5 deletions

View File

@ -19,15 +19,15 @@ int main(int argc, char *argv[])
TAOS_STMT *stmt; TAOS_STMT *stmt;
// connect to server // connect to server
//if (argc < 2) { if (argc < 2) {
// printf("please input server ip \n"); printf("please input server ip \n");
// return 0; return 0;
//} }
// init TAOS // init TAOS
taos_init(); taos_init();
taos = taos_connect("127.0.0.1", "root", "taosdata", NULL, 0); taos = taos_connect(argv[1], "root", "taosdata", NULL, 0);
if (taos == NULL) { if (taos == NULL) {
printf("failed to connect to db, reason:%s\n", taos_errstr(taos)); printf("failed to connect to db, reason:%s\n", taos_errstr(taos));
exit(1); exit(1);