安装MySQLdb-python报错

~
"/etc/ld.so.conf" 3L, 80C written
  File "MySQLdb/__init__.py", line 19, in ?
    import _mysql
  File "build/bdist.linux-i686/egg/_mysql.py", line 7, in ?
  File "build/bdist.linux-i686/egg/_mysql.py", line 6, in __bootstrap__
ImportError: libmysqlclient.so.15: cannot open shared object file: No such file or directory

很是奇怪,另外一个RHEL4.6 安装上了就没事。

搞了1小时,突然觉悟,libmysqlclient.so.15没找到。
#updatedb
#locate libmysqlclient.so.15
发现在
/usr/local/mysql/lib/mysql.bak/libmysqlclient.so.15.0.0
/usr/local/mysql/lib/mysql.bak/libmysqlclient.so.15
/usr/local/mysql/lib/mysql/libmysqlclient.so.15.0.0
/usr/local/mysql/lib/mysql/libmysqlclient.so.15
有。
#vi /etc/ld.so.conf
#ldconfig  -v
再次运行
#python
>>>import MySQLdb #ok,没报错啦。
>>> conn = MySQLdb.connect(host='localhost',user='jack',passwd='MM_x,db='love_mm')         
>>> print conn
>>>

总结:没注意看报错信息,瞎搞一阵。