MAC os10.9 Mysql-python Installation

Source: Internet
Author: User

Install Mysql-python steps on Mac OS:

1. Download MySQL, also known as MySQL Community Server, download version 10.9 can be (according to the system version download), slow on the Baidu disk to find

http://dev.mysql.com/downloads/mysql/


2. Install Mysql-python, a set of APIs that Python calls MySQL, not a MySQL database

Method 1: The command line is lowered by:

sudo easy_install Mysql-python


Method 2: Directly from the online next to the latest, because it is Python code, so do not control whether the DMG or ZIP or tag what format, anyway can run. We recommend getting a copy of the latest code from GitHub.

https://github.com/farcepest/MySQLdb1/

I was under a version of 1.2.5.

https://github.com/farcepest/MySQLdb1/tree/MySQLdb-1.2.5


3. Installation Mysql-python prompt error environmenterror:mysql_config not found

Unzip into the Mysql-python directory, there is a site.cfg, open this configuration file.

Remove the mysql_config in front of you, #表示注释
Modify the MySQL installation directory, if the download is DMG automatic installation is here

Mysql_config =/usr/local/mysql/bin/mysql_config


Then the command line input

sudo python setup.py buildsudo python setup.py install


4. When running Python, report MySQL driver problem:Library not loaded:libmysqlclient.18.dylib

The cause of the error is the newly compiled installation of Lib placed under Mysql_home/lib, the terminal can not find this location, the solution is to do a soft link link to/usr/lib under

sudo ln-s/usr/local/mysql/lib/libmysqlclient.18.dylib/usr/lib/libmysqlclient.18.dylib
You need to run the above command, or there will be errors in the program running.


Perfect Harvest!



MAC os10.9 Mysql-python Installation

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.