QT MySQL Databese connect fail
Solved
General and Desktop
-
Hello i got 11 error on connecting to sql server
Please help
this is my codeQSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL"); db.setHostName("localhost"); db.setDatabaseName("mysql"); db.setUserName("root"); db.setPassword("rootPW"); bool connected = db.open();
and this is the error
i dont know why is this happening,please help me.Thanks -
You forgot to link against the QtSql library.
-
oops,sorry.My version of qt is 6.0.1
-
You forgot to link against the QtSql library.
-
@Christian-Ehrlicher yes,i just realize i forget to add sql to
QT += core gui sql
thanks for respone anyway