hi everyone,i have install mysql on window with vs2008 complete
but when i test a code as belows,it can not load ,plz help
this is a test code:
Qt Code:
  1. #include <QCoreApplication>
  2. #include <QtSql>
  3. #include <QDebug>
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. QCoreApplication a(argc, argv);
  8. QSqlDatabase db=QSqlDatabase::addDatabase("qmysql","db");
  9. db.setHostName("testmysql");
  10. db.setDatabaseName("testdb");
  11. db.setUserName("vanduongbk");
  12. db.setPassword("sa123");
  13. if(!db.open())
  14. {
  15. qDebug()<<"error connect"<<db.lastError().text();
  16. }
  17. else
  18. {
  19. qDebug()<<"connected";
  20. }
  21. //MainWindow w;
  22. // w.show();
  23.  
  24. return a.exec();
  25. }
To copy to clipboard, switch view to plain text mode 

when compile,it have error as :
Starting C:\Documents and Settings\vanduongbk\My Documents\myqtproject\build-mysqlproject1-Desktop-Debug\debug\mysqlproject1...
QSqlDatabase: qmysql driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL3 QMYSQL QODBC3 QODBC QPSQL7 QPSQL
error connect "Driver not loaded Driver not loaded"