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. MySQL Driver Compiled by MinGW 64bit can't work
QtWS25 Last Chance

MySQL Driver Compiled by MinGW 64bit can't work

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.3k 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.
  • L Offline
    L Offline
    Leo.Lei
    wrote on last edited by
    #1

    I have succeed compiling mysql driver with x64-4.8.1-posix-seh-rev2 but in the demo when try to open the database, I got this

    Error - RtlWerpReportException failed with status code :-1073741823. Will try to launch the process directly

    After i try to rebuild the driver for some times, it's still wrong, but the error message is different

    QObject::moveToThread: Current thread (0x256f30) is not the object's thread (0x1c2a210).
    Cannot move to target thread (0x256f30)

    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3
    QSqlError(-1, "Driver not loaded", "Driver not loaded")

    Then I try to use the 32bit version everything goes well.

    Here is my code

    @
    

    QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
    db.setHostName("192.168.0.10");
    db.setPort(3306);
    db.setDatabaseName("tests");
    if ( !db.open("root", "xxxxx"))
    {
    qDebug() << db.lastError();
    }
    else
    {
    qDebug() << "open database succeed!";

        QSqlQuery query;
        query.exec&#40;"show tables;"&#41;;
        while (query.next(&#41;&#41;
        {
            qDebug() << query.value(0).toString();
        }
    }
    

    @


    Best Regards,
    Leo.Lei

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vvishnu.egmail.com
      wrote on last edited by
      #2

      Try to install 64bit mysqlsever
      I am not sure about it

      1 Reply Last reply
      0
      • L Offline
        L Offline
        Leo.Lei
        wrote on last edited by
        #3

        Thanks for you reply.

        Actually, I'm just using 64bit mysql server with ubuntu 13.04 amd64 *version in the virtualbox.

        ————————————————
        Best Regards,
        Leo.Lei

        1 Reply Last reply
        0

        • Login

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