Closed fevral13 closed 12 years ago
And no problem connecting to local mysql server:
In [1]: import umysql
In [2]: conn = umysql.Connection()
In [3]: conn.connect('localhost', 3306, 'root', '', '')
In [4]: conn.query('select 1')
Out[4]: <umysql.ResultSet at 0x2c66cc0>
Are you using gevent?
Den 12 februari 2012 11:27 skrev Serj Zavadsky < reply@reply.github.com
:
When I try to connect with ultramysql to Amazon's db instance, I get weird exception:
In [1]: import umysql
In [2]: conn = umysql.Connection()
In [3]: conn.connect('xxxxx.us-east-1.rds.amazonaws.com', 3306, 'xxxxx', 'xxxxx', 'xxxxx')
SystemError Traceback (most recent call last) /home/fevral13/
in () ----> 1 conn.connect('xxxxx.us-east-1.rds.amazonaws.com', 3306, 'xxxxx', 'xxxxx', 'xxxxx') SystemError: error return without exception set
In [4]: conn.is_connected() Out[4]: True
In [5]: conn.query('select 1')
Error Traceback (most recent call last) /home/fevral13/
in () ----> 1 conn.query('select 1') Error: (0, 'Connection reset by peer when receiving')
But when I use pymysql, for example, everything works:
In [6]: import pymysql
In [7]: c = pymysql.Connect(host='xxxxx.us-east-1.rds.amazonaws.com', port=3306, user='xxxxx', passwd='xxxxx', db='xxxxx')
In [8]: c.query('select 1') Out[8]: 1
So the db is up and connectable
Reply to this email directly or view it on GitHub: https://github.com/esnme/ultramysql/issues/7
Jonas Trnstrm Product Manager e-mail: jonas.tarnstrom@esn.me skype: full name "Jonas Trnstrm" phone: +46 (0)734 231 552
ESN Social Software AB www.esn.me
Yes, I'm using ultramysql with gevent. Creating connection pool with gevent.queue.Queue:
DB_CONNECTION_POOL = 10
pool = Queue()
for i in xrange(DB_CONNECTION_POOL):
c = Connection()
c.connect(DATABASE_HOST, DATABASE_PORT, DATABASE_USER, DATABASE_PASSWORD, DATABASE_NAME)
pool.put(c)
and using it:
c = pool.get()
result = c.query('query')
pool.put(c)
everything works with local mysql server
Then there's something different with Amazon's db instances. If you can spare a DB account for me I could probably have a look at it.
//JT
Den 13 februari 2012 12:20 skrev Serj Zavadsky < reply@reply.github.com
:
Yes, I'm using ultramysql with gevent. Creating connection pool with gevent.queue.Queue:
DB_CONNECTION_POOL = 10 pool = Queue() for i in xrange(DB_CONNECTION_POOL): c = Connection() c.connect(DATABASE_HOST, DATABASE_PORT, DATABASE_USER, DATABASE_PASSWORD, DATABASE_NAME) pool.put(c)
and using it:
c = pool.get() result = c.query('query') pool.put(c)
everything works with local mysql server
Reply to this email directly or view it on GitHub: https://github.com/esnme/ultramysql/issues/7#issuecomment-3937953
Jonas Trnstrm Product Manager e-mail: jonas.tarnstrom@esn.me skype: full name "Jonas Trnstrm" phone: +46 (0)734 231 552
ESN Social Software AB www.esn.me
sent connection details to jonas.tarnstrom@esn.me
Hi, Thanks for the assistance I can connect now with the latest commit.
Hi, Jonas,
thank you very much!
When I try to connect with ultramysql to Amazon's db instance, I get weird exception:
But when I use pymysql, for example, everything works:
So the db is up and connectable