Hi,
I am currently trying to make a small portfolio managing application
using Qt4.3.3 + mysql-5.1. I wanted to use Mysql embedded rather then
full server. I recompiled the qt mysql driver for using mysql embedded
as explained in the Qt manual (qassistant) and the driver compiled
successfully. I installed the newly compiled driver at its appropriate
location. Now when I start my application, I get the following error......
080201 14:10:06 InnoDB: Operating system error number 13 in a file
operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name /var/lib/mysql/ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
Actually I don't know how to use this driver.... or rather I should say
that how to use the embedded MySQL system. Am I supposed to copy the any
files within my application project directory. I tried to search on the
net, but couldn't find much to continue. In my main.cpp (where I
initialise the mysql server connection), I commented the connection
parameters that are used when using the mysql server.
My main.cpp looks like this.....
///////////main.cpp/////////////////
#include <mainmenu.h>
#include <QSqlDatabase>
#include <QSqlError>
#include <QMessageBox>
int main(int argc, char *argv[]){
QApplication app(argc, argv);
QSqlDatabase mdb = QSqlDatabase::addDatabase("QMYSQL");
/*mdb.setHostName("localhost");
mdb.setDatabaseName("portfolio");
mdb.setUserName("rajen");
mdb.setPassword("somePassword");*/
if (mdb.open()){
QString success = "Success!!";
QString con = "Connection Successful.";
QMessageBox *mbox = new QMessageBox(QMessageBox::Information, success,
con, QMessageBox::Ok);
mbox->exec();
}
else {
QMessageBox::critical(0, QObject::tr("Database Error"),
mdb.lastError().text());
}
MainMenu *main = new MainMenu(&mdb);
main->show();
return app.exec();
}
///////////main.cpp/////////////////
Any guidance or some links on the net would be helpful.
Regards,
Rajen.