Make full use of subjective initiative when resources are insufficient.
You do not have the root permission for the test machine. To use a Python script to perform a stress test on the database, you can only install it in your own directory. Therefore, the -- prefix of configure and the path options when installing mysqldb are very important.
1.
Python tar xvf Python-2.6.5.tar.bz2
CD Python-2.6.5
./Configure -- prefix = your_python_dir
Make & make instal
2.
MySQL-python-1.2.3c1.tar.gz mysqldb tar xzvf
CD MySQL-python-1.2.3c1
VI site. cfg modify mysql_config = your_mysql_dir/MySQL-bin/mysql_config
Your_python_dir/bin/Python setup. py build
Your_python_dir/bin/Python setup. py install -- prefix = you_python_dir
This step may prompt
Importerror: No module named setuptools
3.
Setuptool tar xzvf setuptools-0.6c11.tar.gz
CD setuptools-0.6c11
Your_python_dir/bin/Python
Setup. py build
Your_python_dir/bin/
PY
Thon setup. py install
Back
Mysq
L-python-1.2.3c1 directory, execute the last step to install mysqldb:
Your_python_dir/bin/Python setup. py install -- prefix = you_python_dir
4.
Import mysqldb error importerror: libmysqlclient_r.so.16:
Cannot open shared object file: no such file or directory
Solution: Find ~ -Name "libmysqlclient_r.so.16 ":
You_mysql_dir/MySQL-bin/lib/MySQL
Cd ~ & VI. bashrc
Add export LD_LIBRARY_PATH = "your_mysql_dir/MySQL-bin/lib/MySQL $ LD_LIBRARY_PATH"
Restart the session. Import mysqldb is normal.
Thank you, Cat.
Xiao Hong
.