diff --git a/tests/examples/c/prepare.c b/tests/examples/c/prepare.c index 0587d6b6ed87f417210d3748303643d68d840abb..b063d502fccd18d9df845bf998332bfc7b0ddbb6 100644 --- a/tests/examples/c/prepare.c +++ b/tests/examples/c/prepare.c @@ -19,15 +19,15 @@ int main(int argc, char *argv[]) TAOS_STMT *stmt; // connect to server - //if (argc < 2) { - // printf("please input server ip \n"); - // return 0; - //} + if (argc < 2) { + printf("please input server ip \n"); + return 0; + } // init TAOS 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) { printf("failed to connect to db, reason:%s\n", taos_errstr(taos)); exit(1);