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:

If you’re thinking about purchasing a new GPU, we’d greatly appreciate it if you used our Amazon Associate links. The price you pay will be exactly the same, but Amazon provides us with a small commission for each purchase. It’s a simple way to support our site and helps us keep creating useful content for you. Recommended GPUs: RTX 5090, RTX 5080, and RTX 5070. #ad

_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.

Be the first to comment

Leave a Reply