myljim112233 发表于 2015-7-20 16:56:39

MySql 5.5.4.2跟python-mysqldb不兼容?带错误日志

一路默认安装完整个lnmp 1.2包,mysql 能启动,ubuntu 14.04下安装完python-mysqldb,mysql无法启动,错误日志如下

licess 发表于 2015-7-20 20:47:42

apt-get install python-mysqldb
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following extra packages will be installed:
libmysqlclient18 mysql-common
Suggested packages:
python-egenix-mxdatetime mysql-server-5.1 mysql-server python-mysqldb-dbg
The following NEW packages will be installed:
libmysqlclient18 mysql-common python-mysqldb

安装时就有提示会安装mysql-common会导致与已有的mysql配置文件冲突,apt-get purge python-mysqldb libmysqlclient18 mysql-common
正确的安装方法是
apt-get install python-pip python-dev
pip install MySQL-python
安装时肯定会报错mysql_config: not found
cd build/MySQL-python
编辑 site.cfg 将里面的#mysql_config = /usr/local/bin/mysql_config 替换为 mysql_config = /usr/local/mysql/bin/mysql_config
然后再python setup.py install
应该就成功了
页: [1]
查看完整版本: MySql 5.5.4.2跟python-mysqldb不兼容?带错误日志