BANANPI Python-mysql Operation Library
1, first MySQL, Python environment installation
2, download mysql-python-1.2.3.tar.gz and unzip
Tar Xfz mysql-python-1.2.3.tar.gz
3, vi setup_posix.py Edit configuration
Remove Comment: Mysql_config.path = "/usr/local/mysql/bin/mysql_config"
Whereis mysql_config Search to corresponding path
Note: If you do not have mysql_config, you need to install Libmysqld-dev
sudo apt-get install Libmysqld-dev
sudo apt-get install Libmysqlclient-dev
4. Switch to the mysql-python-1.2.3 directory
sudo python setup.py build
Tip Importerror:no module named Setuptools error,
Installing Setuptools-3.2.zip Decompression
sudo unzip Setuptools-3.2.zip
Switch to the setuptools-3.2 directory
sudo python setup.py build
sudo python setup.py install
5. Perform fourth steps sudo python setup.py build
Appears Error:command ' GCC ' failed with exit status 1
sudo apt-get install Python-dev Libevent-dev
sudo apt-get install Libevent-dev
And then in the fourth step of execution
>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>
CentOS Python installation Mysql-python package
Execute commands: sudo yum install Mysql-python
Bananapi Python-mysql Operation Library