Install python first. Because the Fedora14 system already has python, install python under the home Directory; modify the home directory. bash_profile file, add python/bin PATH to PATH; add MySQLdb, encounter many problems linux installation mysqldb: 1. create/usr/local/python2. copy setuptools-0.6c11-py2.6.egg to/usr/local
Install python first. Since the Fedora 14 system already has python, install python in the home Directory;
Modify the. bash_profile file in the home directory and add the python/bin PATH to the PATH;
Many problems encountered when adding MySQLdb
Install mysqldb in linux:
1. Create/usr/local/python
2. Copy setuptools-0.6c11-py2.6.egg to/usr/local/python
3. Execute sh setuptools-0.6c11-py2.6.egg
4.copy mysql-python-1.2.3.tar.gz to the current directory
5. Extract
6. Modify mysql_config in site. cfg to the mysql_config path under the mysql installation directory, for example,/usr/local/mysql/bin/mysql_config.
7. Execute python setup. py build
8. Execute python setup. py install
9. After the operation is successful, run import MySQLdb to check whether the operation is successful. Generally, the following error occurs:
Mysqldb installation error:
1.zip import. ZipImportError: can't decompress data; zlib not available
Solution: recompile the Python source code installation package as follows:
1 tar jxvf Python-2.5.2.tar.bz2 2 cd Python-2.5.2/
3 ls
4 sudo./configure 5 gvim Modules/Setup
6 sudo gvim Modules/Setup
Locate about 454 rows here
# Zlib zlibmodule. c-I $ (prefix)/include-L $ (exec_prefix)/lib-lz
Remove comments
Zlib zlibmodule. c-I $ (prefix)/include-L $ (exec_prefix)/lib-lz
Then re-compile and install python
2. ImportError: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory
# Solution
# Updatedb
# Locate libmysqlclient_r.so.16
/Usr/local/mysql-5.1.30-linux-i686-glibc23/lib/libmysqlclient_r.so.16.0.0
/Usr/local/mysql-5.1.30-linux-i686-glibc23/lib/libmysqlclient_r.so.16
/Usr/local/mysql/lib/mysql/libmysqlclient_r.so.16
/Usr/local/mysql/lib/mysql/libmysqlclient_r.so.16.0.0
# Vi/etc/ld. so. conf
Add the following to ld. so. conf:
/Usr/local/mysql/lib/mysql/
# Ldconfig-v
Test again. Successful!