linux下安装python的mysql模块

原创
2014/08/22 17:42
阅读数 293

1.MYSQL-Python下载地址

http://ncu.dl.sourceforge.net/project/mysql-python/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz



2.解压 
tar -zxvf MySQL-python-1.2.3.tar.gz

3.修改site.cfg

vi site.cfg
a)修改mysql_config为mysql配置文件的路径 /usr/local/mysql/bin/mysql_config 
b)threadsafe = False



4.安装
python setup.py build
python setup.py install



错误说明
_mysql.c:2810: error: expected declaration specifiers before ‘init_mysql’
_mysql.c:2888: error: expected ‘{’ at end of input
error: command 'gcc' failed with exit status 1



解决办法
yum install mysql-devel

yum install python-devel



展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
在线直播报名
返回顶部
顶部