some trouble with MySQLdb

dimitri pater dimitri.pater at gmail.com
Thu Jun 30 02:58:41 EDT 2005


try:
db = MySQLdb.connect(host="localhost", user="user", passwd="pass",
db="myDB")
localhost can be a URL also (if MySQL is set up properly in the first place)
regards,
Dimtiri

On 6/30/05, nephish <nephish at xit.net> wrote:
> 
> Hey there all,
> i have a question about how to point my python install to my sql database.
> 
> when i enter this: db = MySQLdb.connect(user="user", passwd="pass",
> db="myDB")
> 
> i get this:
> Traceback (most recent call last):
> File "<pyshell#1>", line 1, in -toplevel-
> db = MySQLdb.connect(user="user", passwd="pass", db="MyDB")
> File "/usr/lib/python2.4/site-packages/MySQLdb/__init__.py", line 66,
> in Connect
> return Connection(*args, **kwargs)
> File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py", line
> 134, in __init__
> super(Connection, self).__init__(*args, **kwargs2)
> OperationalError: (1049, "Unknown database 'MyDB'")
> 
> i am using the all in one package from lampp (now xampp) and i have
> tested a couple of python scripts from the cgi, but.... nothing that
> connects to the database.
> 
> any ideas?
> 
> thanks
> --
> http://mail.python.org/mailman/listinfo/python-list
> 



-- 
Please visit dimitri's website: www.serpia.com <http://www.serpia.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20050630/6afd13a0/attachment.html>


More information about the Python-list mailing list