eaperezdelgado6031 | 2020-08-19 14:40:11 UTC | #1
Hello I am having this issue when I am trying to connect to a local mysql database using QSqlDatabase.addDatabe method. I've found this issue in a lot of forums, but with no clear solutions especially as most of them as for C++ and I can't understand the Qt documentarion on mysql drivers, (there are no really good documentation for PyQt)
This is error I get when try to run my python script:
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
I am using Windows 10, MySql 8, Python 3.7, PyQt 5.9 and PyQt-tools 5.9 (I am using this version of PyQt because I am also using fbs, the fbs manual says it works better with that version of PyQt5)
This is a useful statement that I read in stackoverflow but it is for C++: """ Remember that qsqlmysql plugin is basically a qt interface that uses mysql-C connector methods. But unfortunately this connector does not distributed with Qt, so you should provide it by yourself. """
In summary I'd like to know which are missing files (.dll, .so, .lib)? where do I get them? and where do I copy them? in case for Python
Please if you need my script, but it is simple: 1) I try to connect using QSqlDatabase.addDatabase('QMYSQL') 2) Instatiate a QSqlTableModel that uses that db connection and sets a single table of that database. 3) Display this single table in a QTableView.
PyQt6 Crash Course — a new tutorial in your Inbox every day
Beginner-focused crash course explaining the basics with hands-on examples.
Thanks in advance for your help
Packaging Python Applications with PyInstaller by Martin Fitzpatrick — This step-by-step guide walks you through packaging your own Python applications from simple examples to complete installers and signed executables.