Unsolved QMYSQL driver not loaded Windows 10 problem
-
I have a problem.
I using Windows 10, MySQL 8.0, Python 3.8.0.
This is error:
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
Connection error.
QSqlQuery::exec: database not openThis is my code:
self.db = QtSql.QSqlDatabase.addDatabase('QMYSQL')
self.db.setHostName('localhost')
self.db.setDatabaseName('cadastro')
self.db.setUserName('root')
self.db.setPassword('1234')
if not self.db.open():
print("Connection error.") -
As always - make sure that the needed dlls for the mysql plugin are available. This can be done be e.g. using Dependency Walker. Searching the forum would also help...
-
You can look at a similar problem that I had here https://forum.qt.io/topic/109245/mysql-connection-on-deployment-machines-not-work-windows