Mac OS X Lion pythonmysql installation configuration record

Source: Internet
Author: User

Mac OS X Lion with Python 2.7.

1. Install Xcode 4.1 via the App Store
2. The official download MySQL for Mac X64,mysqlpython;
3.mysql for Mac has dmg format, download and double-click to install;
4. Configure/etc/paths, add/usr/local/mysql/bin;
5. Open the terminal program to perform sudo ln-s/usr/local/mysql/lib/libmysqlclient.18.dylib/usr/lib/libmysqlclient.18.dylib
6. Decompression Mysqlpython, open terminal, Mysqlpython extract directory, execute:
sudo python setup.py build
sudo python setup.py install
7. Verify that the compilation is installed correctly, enter Python, proceed to the Python command line, and execute the following command:
>>> Import MySQLdb
>>> mysqldb.__version__
' 1.2.3′
>>>
8. If you can return the Pythonmysql version, the installation is successful.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.