MySQLdb Module Question

Robert Meegan robert.meegan at murl.com
Thu Nov 11 20:26:56 CET 1999


Wayne -

According to the MySQLdb documentation, all parameters *must* be 
supplied as keyword arguments.

For example:

	host = 'localhost'
	user = 'wayne'
	password = 'secret'
	db = 'mydb'

	MySQLdb.connect(host = host, user = user, passwd = passwd, db = db)


- Robert 

-- 
Robert Meegan

Murl.com
Making the Internet easier to use - Anyplace, Anytime, Free!



>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 11/11/99, 1:07:24 PM, Wayne Topa <wtopa at mindspring.com> wrote 
regarding MySQLdb Module Question:


>   As a Python newbie, I am having a problem getting the
> MySQLdbmodule-0.1.1 working.  I was able to use the
> MySQLmodule-0.4.1 to access my DB's but thought that I should upgrade
> to the newer module.

>   I can't connect to the Mysql database using
> >>> import MySQLdb
> >>> MySQLdb.connect('',user, passwd, Db)
> Traceback (innermost last):
>   File "<stdin>", line 1, in ?
>       TypeError: too many arguments; expected 1, got 5

> >From what I can understand from the Docs, MySQLdb.connect takes up to
> 9 args, so the above error really confuses me, as does this.

> >>> MySQLdb.connect()
> Traceback (innermost last):
> File "<stdin>", line 1, in ?
> File "/usr/lib/python1.5/site-packages/MySQLdb.py", line 259, in
> __init__
>   self.db = apply(connect, (), kwargs)

> Maybe I don't have the correct Docs?

> Could someone give me an example of some of the syntax of this module,
> please?

> TIA

> Wayne
> --
> According to my calculations the problem doesn't exist.
> _______________________________________________________

> --
> http://www.python.org/mailman/listinfo/python-list







More information about the Python-list mailing list