python - Why can't I do SHOW PROCESSLIST with QtSql (PyQT)? -


I am a Python and QT NB. I do a small app with PyQT4 for monitoring my home MySQL server I was trying to, therefore, the classic show processist was my first idea to parse it and show it in a beautiful UI. Nothing, really.

But for some reasons, when querying this QT SQL module does not return anything, though it works with other queries like SHOW TABLES etc.

I found an old (2002) message in a mailing list [1], and a reference in the maththivity code [2], but none of these clearly expresses it.

Here are some code:

  db = QSqlDatabase.addDatabase ('QMYSQL3') # qmysql also db.setHostName (host) db.setDatabaseName (dbname) db .setUserName (user) db SetPassword (password) db.open () q = QSqlQuery (db) q.exec _ ("show processor") print q.size () # returns 1!  

As I said, it works fine with other queries (SELECT, etc.).

Am I doing something wrong? Thanks!

[1]: lists.trolltech.com/qt-interest/2002-09/thread00104-0.html
[2]: www.google.com/codesearch / p? Hl = es & sa = n & cd = 1 & amp; ct = rc # -zNo3rQOo4A / mythtv / libs / libmyth / dbutil.cpp & l = 657

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -