[Tutor] Python & MySQL... Define port.

Network Administrator administrador.de.red at gmail.com
Mon Feb 9 19:29:21 CET 2009


Hello everybody!


I want to use Python to query a given MySQL database. However, this database
is running on port 3308, instead the traditional 3306.

I read that (example):

MySQLdb.connect(host="dbserv', db='inv', user='smith')

can be used to query a given database; however, it didn't work in my
particular case. This is my code:

connection = MySQLdb.connect (db = "netlogin", user="netadmin", pass =
"r4nas", port="3308")

I appreciate if you give me assistance in the proper sintax of the last
mentioned instruction.

Regards,



GatoLinux.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090209/16976e79/attachment.htm>


More information about the Tutor mailing list