这段代码主要是为了测试Mysql C环境是不是安装好。
1 2 3 4 5 6 7 8 9 10
//file name: dbtest.c #include #include #include int main() { MYSQL mysql; mysql_init(&mysql); return 0; }
接下来编译:
1
gcc -lmysqlclient dbtest.c -o dbtest
如果没有报错,应该就没问题了。