我正在尝试在ubuntu 12.04中安装c ++和mysql之间的连接.我安装了mysql-client,mysql-server,libmysqlclient15-dev,libmysql ++ - dev.但是当我尝试编译代码时,我得到了错误:mysql.h there is no such file.我看着文件夹,有mysql.h文件,我无法理解为什么它找不到它.这是我的代码:
/* Simple C program that connects to MySQL Database server*/
#include <mysql.h>
#include <stdio.h>
main() {
MYSQL *conn;
MYSQL_RES *res;
MYSQL_ROW row;
char *server = "localhost";
char *user = "root";
//set the password for mysql server here
char *password = "*********"; /* set me first */
char *database = "Real_flights";
conn = mysql_init(NULL);
/* Connect to database */
if (!mysql_real_connect(conn, server,
user, password, database, 0, NULL, 0)) …Run Code Online (Sandbox Code Playgroud)