Help req: Problems with MySQLdb

ben.hamilton at gmail.com ben.hamilton at gmail.com
Fri Jun 23 03:53:43 EDT 2006


for x in range(self.MAX_CRAWL_THREADS+1):
            self.con.append(
[MySQLdb.connect(host,username,passwor,database,PORT),0])

PORT is an extra argument you might not have perhaps
rodmc wrote:
> I have written an application that connects to a database on a remote
> machine which uses MySQLdb 1.2.0. The application works perfectly when
> connecting to the database from a remote machine, however when it
> attempts to connect to a database on the same machine a connection
> error is generated. I have attached what little info I can below.
>
> DBSERVERIP = "1.2.3.4"
> db = MySQLdb.connect(host=DBSERVERIP, user="user", passwd="password",
> db="nuke")
> --- it refuses to connect on the above line and the exception is caught
> and a message displayed.
>
> I have tried changing the server IP to "localhost" or the hostname,
> however the same problem arises.
>
> Information: Python 2.3.5, MySQLdb 1.2.0, MySQL 5.0.21 and Windows 2K
> pro.
>
> I would be grateful for any help with this problem.
>
> Kind regards,
>
> rod

Also not catching exceptions is a bad idea (crash thud) for long term
programs short term testing its possible it could be good.




More information about the Python-list mailing list