[Biopython-dev] Re: biopython database connectivity error

Brad Chapman chapmanb at uga.edu
Fri Feb 6 11:29:35 EST 2004

Hello Chidambaram;

>       i have insattled pyhton biopython and all the necessary modules but i 
> cannot connect to the database iam getting errors i dont know why
> ython 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from BioSQL import BioSeqDatabase
> >>> server = BioSeqDatabase.open_database(driver ="MySQLdb", user = "chapmanb",
> ...             passwd = "biopython", host = "localhost", db= "bioseqdb")
> Traceback (most recent call last):
>   File "<stdin>", line 2, in ?
>   File "C:\PROGRA~1\Lib\site-packages\BioSQL\BioSeqDatabase.py", line 51, in 
> ope
> n_database
>     conn = connect(**kw)
>   File "C:\PROGRA~1\Lib\site-packages\MySQLdb\__init__.py", line 63, in Connect
>     return apply(Connection, args, kwargs)
>   File "C:\PROGRA~1\Lib\site-packages\MySQLdb\connections.py", line 58, in 
> __ini
> t__
>     self._db = apply(connect, args, kwargs2)
> _mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server 
> on 'localhost' (10061)")

The problem is not a biopython one, but rather a MySQL one. The
relevant error is the last line:

"Can't connect to MySQL server on 'localhost' (10061)"

Based on the lines you pasted, you are using my code directly from
an example file or documentation. If you look at this line:

server = BioSeqDatabase.open_database(driver ="MySQLdb", user = "chapmanb",
            passwd = "biopython", host = "localhost", db= "bioseqdb")

this indicates you are trying to connect to the database with the
username "chapmanb" (my normal username :-) and the password
"biopython." For your use you'll have to use your actual username and
password to connect to your local MySQL installation. You will also
have to have created the "bioseqdb" database, and populated it with
the BioSQL schema.

Hope this helps some!

More information about the Biopython-dev mailing list