Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMYSQL driver not loaded Windows 10 problem
Forum Updated to NodeBB v4.3 + New Features

QMYSQL driver not loaded Windows 10 problem

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 517 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Evaldo Wolkers
    wrote on last edited by
    #1

    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 open

    This 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.")

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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...

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      3
      • G Offline
        G Offline
        Gulivert
        wrote on last edited by Gulivert
        #3

        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

        1 Reply Last reply
        2

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved