I'm starting using MySQL following step by step a python manual but there is something wrong with the procedure or software I'm using. Here the code:
from PyQt5 import QtCore, QtGui, QtWidgets, QtSql
db = QtSql.QSqlDatabase.addDatabase('QMYSQL')
db.setHostName('localhost')
db.setDatabaseName('shopping')
db.setUserName('root')
db.setPassword('prova')
db.open()
I'm using Python 3.4(x64), PyQt GPL 5.5(x64), MySQL Server 8.0.11(x64), Connector/python(3.4) 8.0.11 on Windows 10.
Usually I run the file using MS-DOS prompt and write the code using notepad. Here the errors that come up:
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers:
QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins
The manual only says that I need MySQL server and MySQLdb module.
I have tried to follow the guidance here https://seppemagiels.com/blog/create-mysql-driver-qt5-windows but I have never used MinGW and never built a plugin. I`m confused