[Tutor] python on windows / mysql on linux

Rick Pasotto rick@niof.net
Wed, 4 Apr 2001 21:44:20 -0400


On Thu, Apr 05, 2001 at 01:19:35AM +0200, Pedro Diaz Jimenez wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Thursday 05 April 2001 00:16, Rick Pasotto wrote:
> > How can I access a MySQL database on my linux box from my windows box
> > using python? Python on the linux box works great.
> Does python on the win box work?

Python works but I can't figure out how to install MySQLdb. The README
file doesn't even mention Windows, just linux, even though the zip file
is called MySQL-python-0.3.5-win32-1.zip.

I edited the setup.py file to change the references to d: to c: and then
from within idle ran 'setup.py build' and'setup.py install'. Both
printed a 0 (does that mean a successful completion?). But when I then
try to import MySQLdb it can't be found.

I know very little about windoz and so I have no idea how to figure what
I'm doing wrong.

> Yes, MySQL can accept queries over a network. Suposing that the MySQL module 
> is also supported on the Win box, you only have to use the connect() method. 
> An easy example:
> 
> import MySQLdb
> 
> db_conn = MySQLdb.connect( user="myuser", passwd="mypasswd", db="mydb",\ 
> host="myhost" ) 
> db_cur = db_conn.cursor()
> db_cur.execute( some_query )
> print db_cur.fetchone()

Yes, that's what I do on the linux box. But first I have to get the
import to work.

Surely there must be some simple instructions somewhere showing how to
install the MySQLdb module on the windoz box.

-- 
Most of the presidential candidates' economic packages involve 'tax
breaks,' which is when the government, amid great fanfare, generously
decides not to take quite so much of your income. In other words,
these candidates are trying to buy your votes with your own money.
		-- Dave Barry

		   Rick Pasotto email: rickp@telocity.com