Mac系統中安裝 MySQL-python資料庫詳解

來源:互聯網
上載者:User

重新安裝easy_install(setuptools)
1,去下載 https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg

2,到終端執行 sudo sh setuptools-0.6c11-py2.7.egg

3,清除下載的setuptools-0.6c11-py2.7.egg

刪除MySQL
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/MySQL*
vim /etc/hostconfig and removed the line MYSQLCOM=-YES-
rm -rf ~/Library/PreferencePanes/MySQL*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.*

Mac下刪除自己安裝的Python
刪除Python架構
sudo rm -rf /Library/Frameworks/Python.framework/Versions/x.x
刪除Python程式
sudo rm -rf “/Applications/Python x.x”
刪除/usr/local/bin目錄下的Python串連
x.x為Python的版本號碼

安裝PHP開發環境
MAMP 都有了

安裝Python開發環境
受累MAMP,被MySQLdb折騰好久。最後,刪除了python重新來過。
安裝python
安裝wxpython
安裝easy_install
安裝mysql-5.1.73-osx10.6-x86_64(64位的mysql,就是為了安裝下面的MySQLdb)
編輯.bash_profile :

# Setting PATH for MySQLdb

PATH="/usr/local/mysql-5.1.73-osx10.6-x86_64/bin:${PATH}"
export PATH
export DYLD_LIBRARY_PATH="/usr/local/mysql-5.1.73-osx10.6-x86_64/lib"
export VERSIONER_PYTHON_PREFER_64_BIT=no
export VERSIONER_PYTHON_PREFER_32_BIT=yes

安裝MySQL-python(sudo easy_install MySQL-python)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.