Using Python and Connecting to MySQL remotely WITHOUT MySQL installed on local computer

Tim Harig usernet at ilthio.net
Wed Nov 17 22:19:16 EST 2010


On 2010-11-18, Steve Holden <steve at holdenweb.com> wrote:
> On 11/17/2010 7:21 PM, Tim Harig wrote:
>> On 2010-11-18, dave <davidreynon at gmail.com> wrote:
>>> http://sourceforge.net/projects/mysql-python/
>>>
>>> Using this package, WITHOUT having MySQL installed on my Mac OS X, how
>>> can I use python to connect to a remote MySQL server?
>>>
>>> All of the tutorials mention having to download MySQL!
>> 
>> You don't have to install all of MySQL, just the client libraries.  I would
>> assume that almost every MySQL connector uses these libraries; but, you
>> might see if the MySQL-ODBC connector will work without them.  It is a long
>> shot.  Your last option would be to recreate your own connector without
>> using the MySQL client libraries.  I am not really sure what the purpose of
>> reinventing this wheel would be.
>
> I believe that the coming trend is to implement the MySQL client
> protocol directly in Python, thereby obviating the need for any MySQL
> client installation on the machine hosting the Python code.

One of the advantages to using the MySQL supplied library is that if the
line protocol changes the connector automatically inherits the work already
done by MySQL for the price of a stable API (yes, I am aware that the MySQL
API *has* changed through the years).  That could be very relevant in the
near future as the probject settles its stable forks.

> The pymysql project at http://code.google.com/p/pymysql/ is one such
> solution, aimed at satisfying Python 3 users without the need to port
> existing low-level client code.

That still looks like alpha code.  Would you be willing to make a statement
as to its stability?



More information about the Python-list mailing list