By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,767 Members | 1,987 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,767 IT Pros & Developers. It's quick & easy.

about accessing mysql

P: n/a
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="r oot",db="nux")
thank you.
Jul 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
sinan , wrote:
hi everybody, i have a small mysql connection code

import MySQLdb
db=MySQLdb.Connection(host="localhost",user="r oot",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="r oot",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
Jul 19 '05 #2

P: n/a
hi,
my table types are MyISAM both local and server, my code can reach to
my locals mysql but cannot reach when running on server.
Jul 19 '05 #3

P: n/a
sinan , wrote:
(...)
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="r oot",db="nux")
thank you.


in addition to Diez observations please tell us:

1) version of mysql server you are trying to connect
1a) is the the mysql db been complied to support Innodb tables?
please issue a "SHOW VARIBLES" command on the mysql console, there
should be some mention on innodb support somewhere.

2) version of mysqldb you are using

bye.

--
deelan, #1 fan of adriana lima!
<http://www.deelan.com/>


Jul 19 '05 #4

P: n/a
oh my system is debian - sarge with python 2.3
Jul 19 '05 #5

P: n/a
i checked innodb support via show variable. they have both same support.
mysql version is 4.0.24_Debian-5-log
MySQLdb module version is 1.2.1g2
they are same packets in debian.
thanks
Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.