qt 5.8 sql connection error:QMYSQL driver not loaded on windows 10

后端 未结 5 945
别跟我提以往
别跟我提以往 2020-12-06 19:24

When i tried to connect to mysql, there is a error:

QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODB         


        
5条回答
  •  半阙折子戏
    2020-12-06 19:54

    This error generally means that Qt MySQL plugin is fine (as it is listed in available drivers), but you are a missing the MySQL dll (thus preventing the driver to load).

    The way to fix it is to place libmysql.dll somewhere in your PATH, e.g. adding the MySQL installation folder to PATH, or copy libmysql.dll in the same folder you have your exe in.

提交回复
热议问题