[Qt-interest] MYSQL data base not opening

Sujan Dasmahapatra sujan.dasmahapatra at gmail.com
Sat Jun 25 15:20:37 CEST 2011


Dear Friends
I have just compiled mysql driver sucessfully in QT plugins. Now I am trying
to access the database. like this

        db = QSqlDatabase::addDatabase("QMYSQL");

        if(db.isValid())

        qDebug() << db.isValid();

        else

        qDebug() << "Database not valid" ;

        db.setHostName("localhost");

        db.setDatabaseName("test");

        db.setPort(3306);

        db.setUserName("guest");

        db.setPassword("guest123");

        dbok = db.open();

        qDebug() << dbok << "\n";

But i can see my database is coming not vcalid......... I am not
understanidng whether my  linker is successfully made or what. I have added
the  mysql4.dll in the local folder .
PLease give me some suggestions. Thanks sujan




-- 
Thanks & Regards
Sujan Dasmahapatra
B.E. (Aeronautics)
Bangalore, India
Ph:91-9900839788
mail id : sujan.dasmahapatra at gmail.com
yahoo msn : dasmahapatra.aerodynamics at yahoo.co.in
icq # 556023244
skype:sujan.dasmahapatra at skyepe.com
msn: sujan.dasmahapatra at hotmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110625/245b6863/attachment.html 


More information about the Qt-interest-old mailing list