MySQL 5.1.x, Python, OS X 10.6


Today I tried to get MySQL 5.1.39 (this version offers UUID_SHORT) working with Python. First you must uninstall mysql, mysqlb, and then issue the following commands:

$ which python
/opt/local/bin/python
$ python --version
Python 2.6.2
$ sudo port install mysql5-devel
$ sudo mysql_install_db5 --user=mysql
$ sudo /opt/local/bin/mysqld_safe5 --user=mysql&
$ /opt/local/lib/mysql5/bin/mysqladmin -u root password 'new-passwd'
$ ARCHFLAGS="-arch x86_64" python setup.py build
$ sudo python setup.py install
$ python
>>> import sys
>>> sys.path
# sys.path should print an entry with
# MySQL_python-1.2.3c1-py2.6-macosx-10.6-i386.egg'
>>> import MySQLdb
>>> MySQLdb.apilevel
'2.0'
>>> 

One Response to “MySQL 5.1.x, Python, OS X 10.6”

  1. MySQL, Python on OS X – Snow Leopard « n o t e 1 9 . c o m Says:

    […] o t e 1 9 . c o m « Aquacue 1st pilot MySQL 5.1.x, Python, OS X 10.6 […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: