0
votes

I'm new here I want to run this code :

QApplication a(argc, argv);
QSqlDatabase::addDatabase("QMYSQL");
teste w;
w.show();
return a.exec();

when I try to run it I become this fault

QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7

I have window7, 32 bit System , Msql 5.1.72, qt.5.1.1, visual Studio 2010

Any advice please ?

2
You can see my answer here. Hope that helps.Saeed Sayyadipour

2 Answers

1
votes

The error message hints that you have missed the QMYSQL plugin. You may take a look at Qt Documentation on how to build it on Windows.

0
votes

Sometimes it is only need to Copy libmysql.dll from %mysql%\lib to C:\Windows