Switching Databases

Carsten Haese carsten.haese at gmail.com
Mon Nov 23 10:59:59 EST 2009


Victor Subervi wrote:
> On Mon, Nov 23, 2009 at 10:08 AM, Carsten Haese <carsten.haese at gmail.com
> <mailto:carsten.haese at gmail.com>> wrote:
> 
>     As I said, the best way we can help you is if you copy the actual error
>     message so that we may diagnose the actual problem and suggest a
>     solution that fixes the problem.
> 
> 
> That gave me the idea that I should simply open two separate
> connections. Here's the error that got thrown with the second connection:
>
> [snip...]
>
>    37   db2 = MySQLdb.connect(host, user, passwd, db)
>
> [snip...]
>
> TypeError: connect() argument 4 must be string, not Connection

Have you tried to *read* and *understand* this error message? My guess
is no. The error message tells you all you need to know. You need to
pass a string as argument 4, but you aren't. <<db>> is a database
connection object, not a string. Change <<db>> to a string containing
the name of the MySQL database to which you want to connect.

--
Carsten Haese
http://informixdb.sourceforge.net




More information about the Python-list mailing list