[Debugging Experience] MySQL - fatal error: mysql/mysql.h: No such file or directory

Machine environment:

Ubuntu 22.04.3 LTS

Error reporting

When compiling a project, a SQL error occurred:

CGImysql/sql_connection_pool.cpp:1:10: fatal error: mysql/mysql.h: No such file or directory
    1 | #include <mysql/mysql.h>
      | ^~~~~~~~~~~~~~ ~
compilation terminated.

problem causes

This is because the MySQL development library is not installed. Just install it and recompile.

Solution

# 安装 libmysqlclient-dev 
# Ubuntu环境

sudo apt-get install libmysqlclient-dev

 

Guess you like

Origin blog.csdn.net/weixin_42839065/article/details/132956859