I don't have root permission and this centos does not have network.
Well, I'm gonna connect mysql with python and the system python doesn't have MySQLdb.
So I have to install my own python under my home.
I install stuffs under usr directory except for mysql which is installed by system administrtor. It is something like this:
~
└── usr
├── bin
├── include
├── lib
├── mysql
└── share
After I installed MySQL-python, and import MySQLdb , it tells me:
Python 2.7.10 (default, Oct 31 2015, 22:04:52)
[GCC 3.4.5 20051201 (Red Hat 3.4.5-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "MySQLdb/__init__.py", line 19, in <module>
import _mysql
File "build/bdist.linux-x86_64/egg/_mysql.py", line 7, in <module>
File "build/bdist.linux-x86_64/egg/_mysql.py", line 6, in __bootstrap__
ImportError: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory
YES, I definitely did this:
ln -s ~/usr/mysql/lib/mysql/libmysqlclient_r.so.16 ~/usr/lib/
I'm stuck here. Anyone can help me out? thx
Well, I finally worked out.
I've missed this:
LD_LIBRARY_PATH=~/usr/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.