QSqlDatabase: QPSQL driver not loaded QSqlDatabase: available drivers: false
时间: 2023-11-20 12:14:31 浏览: 202
QT数据库操作
QSqlDatabase: QPSQL driver not loaded表示无法加载QPSQL驱动程序。在可用的驱动程序中,有QSQLITE、QMYSQL、QMYSQL3、QODBC、QODBC3、QPSQL和QPSQL7。根据引用,这个问题发生在Ubuntu下的Qt5与数据库连接失败的情况下。引用提到了QT连接MySQL时出现QMYSQL driver not loaded的提示,需要将libmysql.dll和libmysql.lib拷贝到Qt目录中。根据这些信息,可能是因为缺少QPSQL驱动程序或者没有正确配置数据库连接导致的。请确保已安装了相应的驱动程序并正确配置了数据库连接。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [报错QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE](https://blog.csdn.net/qq_46655061/article/details/124716167)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [解决QMYSQL driver not loaded的libmysql获取问题](https://download.csdn.net/download/buhuiyaowen/10513329)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文