MySQLdb Python API: Unable to connect

Mondal msmondal at gmail.com
Tue Dec 27 00:39:11 EST 2005


Hi,

I am using MySQL 5.0 beta and Active Python 2.4. I have the correct
version of MySQLdb installed. The problem is that I can't connect to
MySQL through the Active Python interactive window.

Here is a sample error:

>>> c=MySQLdb.Connect(host='localhost',user='root',passwd='',db='shop',port=330­6)
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
  File "C:\Python24\Lib\site-packages\MySQLdb\__init__.py", line 66, in

Connect
    return Connection(*args, **kwargs)
  File "C:\Python24\Lib\site-packages\MySQLdb\connections.py", line
134, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
OperationalError: (2003, "Can't connect to MySQL server on 'localhost'
(10061)")

Please look at the penultimate line again. Here the self argument is
placed second to Connection argument. So I reversed their position. But
the problem persists.


Here is a sample:



>>> c=MySQLdb.Connect(host='localhost',user='root',passwd='',db='shop',port=330­6)


Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
  File "C:\Python24\Lib\site-packages\MySQLdb\__init__.py", line 66, in

Connect
    return Connection(*args, **kwargs)
  File "C:\Python24\Lib\site-packages\MySQLdb\connections.py", line
134, in __init__MyM
    super(self,Connection).__init__(*args, **kwargs2)
OperationalError: (2003, "Can't connect to MySQL server on 'localhost'
(10061)")

What is happening?


Thanks in advance for any help 


Regards 
Mondal




More information about the Python-list mailing list