Python:mysqldb安装错误

Python:mysqldb安装错误,python,mysql,database,installation,Python,Mysql,Database,Installation,所以我一直在努力安装mysqldb包。 当我运行构建时,我会得到一个很长的错误记录,这只是其中的一部分,我会假设除了大量的错误之外,其他都是错误 [rv@med240-183 MySQL-python-1.2.3c1]$ sudo python setup.py build [sudo] password for rv: running build running build_py copying MySQLdb/release.py -> build/lib.linux-i686-2.6

所以我一直在努力安装mysqldb包。 当我运行构建时,我会得到一个很长的错误记录,这只是其中的一部分,我会假设除了大量的错误之外,其他都是错误

[rv@med240-183 MySQL-python-1.2.3c1]$ sudo python setup.py build
[sudo] password for rv:
running build
running build_py
copying MySQLdb/release.py -> build/lib.linux-i686-2.6/MySQLdb
running build_ext
building '_mysql' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC -Dversion_info=(1,2,3,'gamma',1) -D__version__=1.2.3c1 -I/usr/include/mysql -I/usr/include/python2.6 -c _mysql.c -o build/temp.linux-i686-2.6/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -DUNIV_LINUX
_mysql.c:36:23: error: my_config.h: No such file or directory
_mysql.c:38:19: error: mysql.h: No such file or directory

有什么想法吗?

您不应该通过sudo运行build,而应该只安装。
yum install mysql-devel