title: Python: QSqlDatabase: QMYSQL driver not loaded
body: <p>I am running python 2.7.3 (python-2.7.3.amd64.msi) from <a href="http://www.python.org/getit/" rel="nofollow">http://www.python.org/getit/</a></p>
  
  <p>I am using these installers from: <a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/" rel="nofollow">http://www.lfd.uci.edu/~gohlke/pythonlibs/</a></p>
  
  <ul>
  <li>PyQt-Py2.7-x64-gpl-4.9.6-1.exe</li>
  <li>PySide-1.1.2.win-amd64-py2.7.exe</li>
  <li>MySQL-python-1.2.4.win-amd64-py2.7.exe</li>
  </ul>
  
  <p>I also tried the pyqt and pyside binaries from:</p>
  
  <ul>
  <li><a href="http://www.riverbankcomputing.com/software/pyqt/download" rel="nofollow">http://www.riverbankcomputing.com/software/pyqt/download</a></li>
  <li><a href="http://qt-project.org/wiki/PySide_Binaries_Windows" rel="nofollow">http://qt-project.org/wiki/PySide_Binaries_Windows</a></li>
  </ul>
  
  <p>I am getting the error "QSqlDatabase: QMYSQL driver not loaded" in the following python code.  My best guess is that the pyside and pyqt binary installers above did not build qt to include QMYSQL?  Can anyone confirm that AND more importantly, direct me to an installer that has the QMYSQL driver built?  I am not prepared to attempt compiling the qt library myself.  Any help is appreciated.</p>
  
  <pre><code>import sys
  
  from showrec import *    # import qtdesigner ui (converted using pyside-uic)
  
  from PySide import QtGui, QtSql
  
  #===================================================================
  # 
  #===================================================================
  
  def createConnection():
  
      db = QtSql.QSqlDatabase.addDatabase('QMYSQL')
  
      db.setHostName('localhost')
      db.setDatabaseName('mydatabase')
      db.setUserName('userid')
      db.setPassword('password')
      db.open()
      print (db.lastError().text())
      return True
  
  #===================================================================
  #
  #===================================================================
  
  class MyForm(QtGui.QDialog):
  
      def __init__(self, parent=None):
  
          #super(MyForm, self).__init__(parent)   # I suspect this is needed?
  
          QtGui.QWidget.__init__(self,parent)
          self.ui = Ui_Dialog()
          self.ui.setupUi(self)
  
          self.model = QtSql.QSqlDatabase(self)
          self.model.setTable("products")
          self.model.setEditStrategy(QtSql.QSqlTableModel.OnManualSubmit)
          self.model.select()
          self.ui.tableView.setModel(self.model)
  
  #===================================================================
  # main
  #===================================================================
  
  if __name__ == "__main__":
  
      app = QtGui.QApplication(sys.argv)
  
      if not createConnection():
          sys.exit(1)
  
      myapp = MyForm()
      myapp.show()
  
      sys.exit(app.exec_()) 
  </code></pre>
  
  <p>This the the gui code:</p>
  
  <pre><code>from PySide import QtCore, QtGui
  
  class Ui_Dialog(object):
      def setupUi(self, Dialog):
          Dialog.setObjectName("Dialog")
          Dialog.resize(400, 300)
          self.tableView = QtGui.QTableView(Dialog)
          self.tableView.setGeometry(QtCore.QRect(20, 20, 256, 192))
          self.tableView.setObjectName("tableView")
  
          self.retranslateUi(Dialog)
          QtCore.QMetaObject.connectSlotsByName(Dialog)
  
      def retranslateUi(self, Dialog):
          Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
  </code></pre>