[Pythonmac-SIG] building mysqldb on mac os x server

Calvin calvin at xmission.com
Sat Aug 14 07:41:05 CEST 2004


Here are the instructions I keep for myself for installing MySQLdb:

*****
Install MySQLdb 
mysql - python:
http://sourceforge.net/projects/mysql-python/
http://sourceforge.net/project/showfiles.php?group_id=22307&release_id=182854

thanks to Andy Dustman.

Used 0.9.3b1


The include and library directories should be where your mysql include 
and lib directories are located.  Also, make the version your version.  
identify your version by typing on a command line:
$ mysqladmin version 

modify the following lines in setup.py   

mysqlversion = tuple(map(int, string.split(os.getenv('mysqlversion', 
'4.0.13'), '.')))

modify setup.py:
include_dirs = [
    '/usr/local/mysql/include'
    ]
library_dirs = [
    '/usr/local/mysql/lib'
    ]

Rem the following lines if crypt is not installed.
#if mysqlversion > (4,0,0):
#    libraries.append("crypt")


also:

elif sys.platform == "darwin": # Mac OS X
    include_dirs.append('/usr/local/mysql/include')             
    library_dirs.append('/usr/local/mysql/lib')     

here are the basic instructions:
	$ tar xfz MySQL-python-0.9.2.tar.gz
	$ cd MySQL-python-0.9.2
	--modify setup.py as above--
	$ python setup.py build
	$ su
	$ python setup.py install

*****

> 
> Thanks for the response.
> 
> I think I've tried that but I'll look again.  MySQL came preinstalled 
> with the server edition of mac os x but, sadly, MySQLdb didn't.  Has any 
> one successfully installed MySQLdb with a MySQL installation that wasn't 
> installed by fink?
> 
> dustin
> 
> Chris Miles wrote:
> 
> > Hi,
> >
> > /sw/ is managed by fink, so it looks like mysqldb simply assumes that 
> > on Darwin(OS X) MySQL has only been installed by fink.
> >
> > If you have installed it into a different location (or don't use 
> > fink), you can try modifying setup.py with the location of your 
> > MySQL's include and lib paths.
> >
> > I don't use MySQL on OS X, but this is what the problem appears to be 
> > from the info you've sent.  Hope that helps.
> >
> > Cheers,
> > Chris
> >
> 
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
> 



More information about the Pythonmac-SIG mailing list