PDA

View Full Version : MySQL and QT



arjoshi
11th March 2011, 13:57
Hello:

I have mysql 5.x and QT 4.x installed on Suse Linux. I would like to access mysql through QT. I searched for a solution on the web but haven't found a satisfactory one.

I tried the following code:


#include <QCoreApplication>
#include <QtSql>

int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);

qDebug() << QSqlDatabase::drivers();

return a.exec();
}

but got the output as:

("QSQLITE",QPSQL7","QPSQL")


would apreciate any help.

unit
11th March 2011, 13:59
do you create qt plugin for mysql?

stampede
11th March 2011, 16:14
You may be interested in this thread : link (http://www.qtcentre.org/threads/39406-building-mysql-plugin?p=181062#post181062)
Have you tried to search the forum for "MySQL" ? There are many, many threads on this subject.

arjoshi
13th March 2011, 06:50
unit: With reference to your comment: "Try read Qt documentation before ask stupid question."
please do not be rude.

unit
13th March 2011, 08:35
:) It's not comment. it' only signature to all my posts.

Gokulnathvc
15th March 2011, 10:07
Don't think there are no crocodiles because the water is calm.

freely
15th March 2011, 15:04
Very interesting.
I have the same problem when I need to access MySQL database from Qt application on Windows
There is no MySQL database support ( through plugin dll as it is at Qt ) , no MySQL plugin in LGPL Qt version
Where to get mysqlplugin.dll for database support? Where to get souce codes or dll file for MySQL support.
When no MySQL plugin I've used QT - MYSQL -ODBC bridge on windows to access the database
Pavel

wysota
15th March 2011, 15:11
You need the plugin available and you also need MySQL libraries available as the plugin depends on them.