Basic qt with mysql?
-
Yes. And in case of one db without name (i.e. default database) you don't need to provide it to QSqlQuery.
-
You can use "isValid()":http://doc.qt.nokia.com/4.6/qsqldatabase.html#isValid
-
now it is saying
@
QSqlDatabase: QMysql driver is not loaded
QSqlDatabase: available drivers :QSQLITE QSQLITE2
@i have installed Mysql driver here "Your text to link here...":http://developer.qt.nokia.com/forums/viewthread/1121/P30/
-
It says that something is wrong with your mysql plugin. What do you have in your plugins/sqldrivers folder?
-
i have 10 different folders and four files. files with names are libqsqlmysql.so, qsqldriverbase.pri, readme, sqldriver.pro
-
i also run this code
@
#include <QCoreApplication>
#include <QSqlDatabase>
#include <QSqlError>
#include <QStringList>
#include <QtDebug>int main( int argc, char *argv ) { QCoreApplication app( argc, argv ); qDebug() << QSqlDatabase::drivers(); }
@
it displays this
@
("QSQLITE","QSQLITE2")
@ -
Not folder with plugin sources, but folder with qt plugin binaries. It is folder named plugins/sqldrivers in root of your Qt folder.
-
well i checked this in this path home/qtsdk-2010.05/qt/src/plugins/sqldrivers
I have two plugins folders. one in home/qtsdk-2010.05/qt/plugins
in this plugin folder i have 11 folders with one named sqldrivers. inside this sqldriver folder i have these 3 files "libqsqlite.so, libqsqlite2.so, libqsqlpsql.so"the other is mentioned above which inside src.
-
Put mysql plugin in this folder.
-
from which folder i can get mysql plugin and what is the name of that mysql plugin? you mean this one libqsqlmysql.so which is in src/plugins/sqldrivers/mysql folder?
-
yes