System: centos 5.9
Required software packages: setuptools-0.6c11.tar.gz
MySQL-python-1.2.3.tar.gz
1. Install setuptools-0.6c11
The code is as follows: |
Copy code |
Wget -- no-check-certificate http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz Tar zxf setuptools-0.6c11.tar.gz & cd setuptools-0.6c11 Python setup. py build Python setup. py install |
2. Install MySQL-python-1.2.3
The code is as follows: |
Copy code |
Wget http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz/download Tar zxf MySQL-python-1.2.3.tar.gz & cd MySQL-python-1.2.3 Python setup. py build Python setup. py install |
If you are running python setup. in py build, if EnvironmentError: mysql_config not found is reported, first find the location of mysql_config and use find/-name mysql_config. Mine is in/usr/local/mysql/bin/mysql_config, then modify the site under the MySQL-python-1.2.3 directory. in the cfg file, remove the comments of mysql_config = XXX and change them to mysql_config =/usr/local/mysql/bin/mysql_config, which is based on your own machine.
Run the following command.
The code is as follows: |
Copy code |
Python setup. py build Python setup. py install |
Okay, solved the problem of MySQLdb. I want to continue to study the web monitoring system.
Ubuntu system
Direct
Sudo apt-get install python-mysqldb
If you compile
Sudo apt-get install libmysqlclient-dev is required