Newbie: How to connect to MySQL?

Steve Holden sholden at holdenweb.com
Wed Jan 15 17:43:11 CET 2003


"Eduardo Cancino" <lalo at ciceana.org.mx> wrote in message
news:mailman.1042643607.2959.python-list at python.org...
> Hi everybody!
>
> I downloaded the mysql-python from sourceforge, and I tried to install
> it on my Mac0S 10.2.1
> but even i have the Developer tools the:
>
> python setup.py build
> python setup.py install
>
> commands doesn't find my compiler.
>
> I looked in www.python.org, some of this but didn't find it.
>
> Where I cand find a installing tutorial or something i can get to start
> programming python with databases?
>
> Is there a db module like dbi in perl?
> And the cgi module works as the perl one?
>
>

Eduardo:

I can't answer your question as to why your command-line isn't finding the
Python interpreter. That's another issue. However, if you're sure you have
/usr/bin/python then as long as setup.py is marked as executable the command

    setup.py build

should work.

As far as your questions about "is there a db module", Python database
modules should conform the the Python DB API version 2, thereby offering a
reasonably standard interface. You can find a description at

    http://www.python.org/peps/pep-0249.html

The MySQLdb module you have downloaded offers a fairly complete
implementation, along wiht a few added tweaks and wrinkles like "dictionary
cursors".

As for the CGI module: walk before you run! ;-)

regards
--
Steve Holden                                  http://www.holdenweb.com/
Python Web Programming                 http://pydish.holdenweb.com/pwp/
Bring your musical instrument to PyCon!    http://www.python.org/pycon/







More information about the Python-list mailing list