2015年6月7日 星期日

Python 連接 MySQL 設定、安裝與一些智障錯誤

安裝 MySQLdb

Download  (官方網站下載 最新版)

MySQL-python-1.2.4b4.tar.gz Download (官方網站下載 版本:1.2.4b4)
MySQL-python-1.2.4b4.tar.gz Download (ge.tt下載 版本:1.2.4b4)





($ cd /home/pi/Downloads) 檔案位置
$ sudo tar -xzvf MySQL-python-1.2.4b4.tar.gz
$ sudo cd MySQL-python-1.2.4b4
$ sudo python setup.py build
$ sudo python setup.py install


*python setup.py build 錯誤:
environmenterror( s not found (mysql_config.path ))

$ sudo apt-get install libmysqlclient-dev

error: command 'gcc' failed with exit status 1

$ sudo apt-get install python-dev



Reference:
http://www.tutorialspoint.com/python/python_database_access.htm

http://stackoverflow.com/questions/7475223/mysql-config-not-found-when-installing-mysqldb-python-interface

沒有留言:

張貼留言