MySQLdb Python API: Unable to connect
Nicolas Kassis
nic.kassis at gmail.com
Tue Dec 27 03:10:50 EST 2005
Dennis Lee Bieber wrote:
>On 26 Dec 2005 21:39:11 -0800, "Mondal" <msmondal at gmail.com> declaimed
>the following in comp.lang.python:
>
>
>
>>>>>c=MySQLdb.Connect(host='localhost',user='root',passwd='',db='shop',port=3306)
>>>>>
>>>>>
>
> So what is that - doing in the port number... So far as I know,
>nothing reasonable lives on port 324...
>
>
>
I don't see anything with 324 in there ? What do you mean ?
> If that is supposed to be the standard MySQL port, just leave it
>off... Granted, I'm not running 5.x... (and I'm behind both a router
>firewall and a software firewall AND MySQL's own authorization scheme,
>so the user/password won't do anyone any good at getting into my system)
>
> myDB = MySQLdb.connect(host="localhost",
> user="BestiariaCP",
> #passwd="web-asst",
> db="bestiaria")
>
> Note the lack of a port number specification. The default port for
>MySQL is 3306; if your server is running on the default, you don't need
>to specify it. Error 10061 is the generic Windows socket "connection
>refused" -- since I doubt you have anything on port 324, that is to be
>expected.
>
>
Just to make sure, ( Not trying to be a smart ass) are you sure the
database is running ? That seems like the most obvious thing.
Nic
More information about the Python-list
mailing list