[PyQt] How to communicate with mysql?

Ryen Lee diyer2002 at gmail.com
Sat Jan 26 18:05:38 GMT 2008


Hi everybody! I am a newbie for PyQT.Now I am write a simple programm which
use mysql as its database,but I find it is very diffucult to use the PyQT
APIs.I write sth like that:

db = QtSql.QSqlDatabase.addDatabase("QMYSQL")
db.setHostName("127.0.0.1")
db.setDatabaseName("test")
db.setUserName("root")
db.setPassword("123456")
db.open()

but it just doesn't work.PS:My mysql version is 5.1,is that the problem? I
try to use MySQLdb to implement my own QSqlDriver and  QSqlResult,Could
anybody give me some examples?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20080126/64d327e5/attachment.html


More information about the PyQt mailing list