about accessing mysql
Diez B. Roggisch
deets at web.de
Fri Jun 10 10:55:12 EDT 2005
sinan , wrote:
> hi everybody, i have a small mysql connection code
>
>
>>>>import MySQLdb
>>>>db=MySQLdb.Connection(host="localhost",user="root",db="nux")
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "/usr/lib/python2.3/site-packages/MySQLdb/__init__.py", line
> 66, in Connect
> return Connection(*args, **kwargs)
> File "/usr/lib/python2.3/site-packages/MySQLdb/connections.py", line
> 156, in __init__
> self.autocommit(0)
> _mysql_exceptions.OperationalError: (1193, "Unknown system variable
> 'AUTOCOMMIT'")
>
>
> these command works at my computer but when i want to do in my server,
> i get these messages as you seen, my both computer and server have
> same python, same MySQLdb module and same database with same
> priviliges.also how can i connect to remote database? is that work ?
> db=MySQLdb.Connection(host="192.168.0.120",user="root",db="nux")
> thank you.
Are you aware that transactions are a very recent feature of mysql and
that tables have to be created as InnoDB tables? I don't know much about
that stuff but can imagine that on your server this has not been done
properly.
Diez
More information about the Python-list
mailing list