[Qt-interest] could not able to open mysqlsql database

Yuvaraj R yuvaraj at ongobiz.com
Wed Sep 30 21:51:09 CEST 2009


Thanks Robert..

Now it is connecting... i resolved myself..

what i have to do ,if i use my application in mysql un installed systems


Thanks

Yuvaraj R

On Thu, Oct 1, 2009 at 1:08 AM, Robert Escott <robert at binarylogic.co.za>wrote:

>  Hi Yuvaraj
>
> I'm sorry to hear you're still struggling.
>
> Here's a quick checklist:
>
> 1) You have libmysql.dll in the same directory as your project executable.
> 2) You have qsqlmysql4.dll in a sub-directory of your project executable
> directory called sqldrivers
> 3) You have MySQL server installed on your machine and the service is
> running.
>
> If any of the above are not right, you won't be able to connect.
>
> Regards,
>
> Robert
>
> ----- Original Message ----- *From:* Yuvaraj R <yuvaraj at ongobiz.com>
> *To:* qt-interest <qt-interest at trolltech.com>
> *Sent:* Wednesday, September 30, 2009 8:04 PM
> *Subject:* [Qt-interest] could not able to open mysqlsql database
>
> Hi All
>
> I could not able to open  mysql  database..
>
> please help me
>
> my connection code is :
>
> QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
>
> db.setDatabaseName("Addu");
>
> db.setHostName("localhost");
>
> db.setUserName("root");
>
> db.setPassword("root");
>
> db.setPort(3306);
>
> if (!db.open()) {
>
> QMessageBox::critical(0, qApp->tr("Cannot open database"),
>
> qApp->tr("Unable to establish a database connection.\n"
>
> "This example needs SQLite support. Please read "
>
> "the Qt SQL driver documentation for information how "
>
> "to build it.\n\n"
>
> "Click Cancel to exit."), QMessageBox::Cancel);
>
> return false;
>
> }
>
> return true;
>
> }
>
>
> Please help me
>
>
> I am struggling since last two days ..
>
>
> Thanks
>
>
> Yuvaraj R
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091001/97278420/attachment.html 


More information about the Qt-interest-old mailing list