<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:3.0cm 2.0cm 3.0cm 2.0cm;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=DA><div class=WordSection1><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US>Why is the MySQL driver not loaded when it’s available in C:\Python36\Lib\site-packages\PyQt5\Qt\plugins\sqldrivers\qsqlmysql.dll and </span><span lang=EN-US>print(db.isDriverAvailable('QMYSQL'))<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Returns True.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>The setup is win10, Python 3.6.2 and installing the latest wheel Pyqt5.9.1 and SIP 4.19.3 by Pip 9.01. Hope someone can help me solving this time consuming problem finding and no solutions.</span><span lang=EN-US><o:p></o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt'><span lang=EN-US>T<b><u>he Code:</u></b></span></p><p class=MsoNormal><span lang=EN-US># coding=utf-8<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>from PyQt5.QtWidgets import QMessageBox<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>from PyQt5 import QtSql</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>def createconnection():<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>db = QtSql.QSqlDatabase.addDatabase('MYSQL')<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>print(db.isDriverAvailable('QMYSQL'))<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>db.setHostName("192.168.1.225")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>db.setPort(3306)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>db.setDatabaseName("Database_dispo_4")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>db.setUserName("T3")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>db.setPassword("xxxx")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>print(db.open())<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>print(db.lastError().text())<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>print(db.drivers()<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><b><u><span lang=EN-US>Consol output</span></u></b><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>C:\Python36\python.exe "C:\Program Files\JetBrains\PyCharm 2017.2\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 54371 --file C:/Users/Doc/Documents/Pyqt_SQL/src/Qtabwindow.py<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>pydev debugger: process 4020 is connecting<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Connected to pydev debugger (build 172.3317.103)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>True<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>False<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Driver not loaded Driver not loaded<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>['QSQLITE', 'QMYSQL', 'QMYSQL3', 'QODBC', 'QODBC3', 'QPSQL', 'QPSQL7']<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal>Kind regards<o:p></o:p></p><p class=MsoNormal>Gert Jorgensen<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>