Drogon cannot detect MySQL on Fedora (MySql was not found)

6 hours ago 1
ARTICLE AD BOX

I’m trying to build a C++ backend using Drogon with MySQL support, but Drogon fails to detect MySQL during CMake configuration.


Environment

Fedora (latest)

GCC 15.2.1

CMake (recent)

Drogon 1.9.12


Problem

When running CMake for Drogon:

cmake ..

I get:

-- MySql was not found.

MySQL installation

I installed MySQL using:

sudo dnf install mysql-community-devel

The client library exists:

ls /usr/lib64/mysql/libmysqlclient.so

Output:

/usr/lib64/mysql/libmysqlclient.so

pkg-config

MySQL is visible through pkg-config:

pkg-config --libs mysqlclient

Output:

-L/usr/lib64/mysql -lmysqlclient

Headers

Headers are located at:

/usr/include/mysql

However, I suspect these may not be the correct MySQL headers.

For example:

grep -R "mysql_real_query_start" /usr/include/mysql

Returns nothing.


What I tried

I attempted several approaches:

Reinstall MySQL dev packages

Remove MariaDB-related packages

Force MySQL paths in CMake

cmake .. \ -DMYSQL_INCLUDE_DIR=/usr/include/mysql \ -DMYSQL_LIBRARIES=/usr/lib64/mysql/libmysqlclient.so

Result:

MySql was not found.

Use MySQL tarball (custom headers/libs)

cmake .. \ -DCMAKE_INCLUDE_PATH=~/Downloads/mysql/include \ -DCMAKE_LIBRARY_PATH=~/Downloads/mysql/lib

Still:

MySql was not found.

Try disabling MariaDB detection

cmake .. -DUSE_MYSQL=ON -DUSE_MARIADB=OFF

Result:

USE_MARIADB not used MySql was not found.

Additional observation

At one point Drogon detected MariaDB instead:

-- Ok! We find mariadb!

But compilation failed with errors like:

mysql_real_query_start not declared MYSQL_WAIT_READ not declared

Question

What is the correct way to make Drogon detect MySQL on Fedora?

Is MariaDB interfering with MySQL detection?

Are Fedora’s MySQL headers incompatible with Drogon?

Is there a known issue with Drogon’s MySQL detection?


Expected result

CMake should detect MySQL and enable MySQL support in Drogon.

Read Entire Article