MySQL Forums
Forum List  »  Connector/Python

Python List to store connections.
Posted by: Victor Sira
Date: March 07, 2008 12:36AM

I'm trying to setup a script that will connect multiple times to a mysql server, thus I'm initializing I'm trying to initilize a list with these connections but that's not working for me. Do you know why?

for i in [0, 1, 2, 3, 4]:
try:
db=MySQLdb.connect(db = "mysql", host = "server", passwd = "password", user = "user")
print "Connected %s" % ( i )
except:
print "Can't connect to the server"
sys.exit(1)


Thanks for the response.

--Victor

Options: ReplyQuote


Subject
Written By
Posted
Python List to store connections.
March 07, 2008 12:36AM


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.