my_config.h: No such file or directory on CentOS 8

When I tried to install MySQL-python module on a CentOS 8 machine, I got this error message:

_mysql.c:44:10: fatal error: my_config.h: No such file or directory

On previous distribution, I can add the my_config.h by installing the mysql-devel package. However, my_config.h is not included in the package on CentOS 8.

I could not find any package for CentOS 8 with that file. However, I found the source file for 8.0.11 on MySQL’s official site.

https://dev.mysql.com/doc/dev/mysql-server/8.0.11/my__config_8h_source.html

I created a my_config.h file under /usr/include and copy the content of the source file to the file I just created. I was able to install MySQL-python module afterward.


This post may contain affiliated links. When you click on the link and purchase a product, we receive a small commision to keep us running. Thanks.


Be the first to comment

Leave a Reply