MySQL Forums
Forum List  »  Connector/Python

Re: MySQLdb on Mac OS X 10.5.8
Posted by: Geert Vanderkelen
Date: October 17, 2009 03:09PM

Hello Annet,

Annet Vermeer Wrote:
..
> Since I don't know much about Unix, I don't
> understand the instructions provided here.

Aye, that's a bit the problem with MySQLdb
since it needs compiling: one needs to be a
bit UNIX savvy.

(Just a FYI, the 'shell>' means the prompt, usually
the $. We just use it as it is more universal)

> shell> PATH="/usr/local/mysql/bin:$PATH"
> shell> tar xzf MySQL-python-1.2.3c1.tar.gz
> shell> cd MySQL-python-1.2.3c1
> shell> ARCHFLAGS="-arch x86_64" /usr/bin/python setup.py build
> shell> /usr/bin/python setup.py install
>
> I don't know whether the $PATH has already been
> set.

That doesn't really matter. It's OK to set it again
if /usr/local/mysql/bin is available to you.

Actually, simply executing the following on in the
Terminal should give you an idea:
shell> mysql_config

If it says 'command not found', set the $PATH as
explained above.

> Since MySQL-python-1.2.3c1.tar.gz has already been
> unzipped; there is a folder MySQL-python-1.2.3c1
> in the downloads folder, I assume I don't have to
> run shell> tar xzf MySQL-python-1.2.3c1.tar.gz

Indeed, you untar/unzipped it clicking in Finder?
The 'tar xzf' does the same, but from the shell (aka
Terminal).

> MySQL-python-1.2.3c1 resides in the download
> folder so shell> cd MySQL-python-1.2.3c1 doesn't
> seem to make sense. Where should the folder go?

It doesn't go anywhere. 'cd' means 'change directory'.
You change to the directory 'MySQL-python-1.2.3c1'.
You got it in Downloads? Then this should work:

shell> cd ~/Downloads/MySQL-python-1.2.3c1

Tip, to find out where you are in the Terminal, use
shell> pwd

> shell> ARCHFLAGS="-arch x86_64" /usr/bin/python
> setup.py build

You are on 10.5, I think you should do:

shell> /usr/bin/python setup.py build
shell> /usr/bin/python setup.py install

> I have no idea what the two lines of code above
> do. I downloaded the MySQL Installer Package for
> Mac OS X 10.5 x86 not x86-64.

Yes, x86 is good, that's why you don't have to
set the 'ARCHFLAGS' thingy.
The above two lines do:
1) compiles (builds) MySQLdb using the MySQL
client libraries
2) installs MySQLdb

> Could you please provide me with more detailed
> instructions on how to get MySQLdb installed.

The above is basically it :-) It's a chore for
less experienced users, especially the compiling
part. Just post here again if you got
more problems. (it might have been better to start
a new topic instead for 10.5).

BTW, we hope to release MySQL Connector/Python
which could help a bit, and make it easier, but
we're still long way of releasing I'm afraid.
Working on it though!

Cheers,

Geert

Geert Vanderkelen
Software Developer at Oracle

Options: ReplyQuote


Subject
Written By
Posted
September 23, 2009 01:01PM
September 24, 2009 01:21AM
September 24, 2009 12:20PM
October 17, 2009 10:34AM
Re: MySQLdb on Mac OS X 10.5.8
October 17, 2009 03:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.