1、安装mysql服务器及客户端
sudo apt-get install mysql-server mysql-client
2、安装mysql C语言接口
sudo apt-get install libmysql++-dev
3、编译文件(mysql_config)
#mysql_config
CFLAGS +=-I/usr/include/mysql
LDFLAGS +=-L/usr/lib/arm-linux-gnueabihf -lmysqlclient -lpthread -lz -lm -ldl
test:test.o
$(CC) $^ -o $@ $(CFLAGS) $(LDFLAGS)
clean:
$(RM) *.o test