Im trying to connect to a mysql server with this code:

Qt Code:
  1. #include "testemysql1.h"
  2. #include <QSqlDatabase>
  3. #include <QtSql>
  4. #include <QMessageBox>
  5.  
  6. testeMYSQL1::testeMYSQL1(QWidget *parent, Qt::WFlags flags)
  7. : QMainWindow(parent, flags)
  8. {
  9. ui.setupUi(this);
  10. }
  11.  
  12. testeMYSQL1::~testeMYSQL1()
  13. {
  14.  
  15. }
  16.  
  17.  
  18. void testeMYSQL1::on_pushButton_clicked()
  19. {
  20. QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
  21. db.setHostName("servidor");
  22. db.setDatabaseName("teste");
  23. db.setUserName("root");
  24. db.setPassword("");
  25. if (!db.open())
  26.  
  27. QMessageBox::critical(0, tr("Error"), QString("The error:\n%1").arg(db.lastError().text()));
  28.  
  29. // bool ok = db.open();
  30. //lineEdit
  31. }
To copy to clipboard, switch view to plain text mode 

But I got this error:

Qt Code:
  1. QSqlDatabase: QMYSQL driver not loaded
  2. QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC QPSQL7 QPSQL
To copy to clipboard, switch view to plain text mode 

Im using QT4.4 Commercial and Visual Studio 2005.

Thanks in advance
Renan