[closed]Mysql driver not loaded error (Ubuntu Desktop 12.04)



  • OS: Ubuntu Desktop 12.04
    QT: 5.1.1
    Mysql Driver: compiled from source
    ldd command show that everything ok
    @test(at)penguin:~/Qt/5.1.1/gcc/plugins/sqldrivers$ ldd libqsqlmysql.so
    linux-gate.so.1 => (0xb77da000)
    libmysqlclient.so.18 => /usr/lib/i386-linux-gnu/libmysqlclient.so.18 (0xb7494000)
    libQt5Sql.so.5 => /home/test/Qt/5.1.1/gcc/lib/libQt5Sql.so.5 (0xb7454000)
    libQt5Core.so.5 => /home/test/Qt/5.1.1/gcc/lib/libQt5Core.so.5 (0xb6fd0000)
    libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb6eeb000)
    libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb6d41000)
    libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb6d2b000)
    libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb6d26000)
    libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb6d0a000)
    libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb6cde000)
    libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb6cc0000)
    libicui18n.so.51 => /home/test/Qt/5.1.1/gcc/lib/libicui18n.so.51 (0xb6a9e000)
    libicuuc.so.51 => /home/test/Qt/5.1.1/gcc/lib/libicuuc.so.51 (0xb6925000)
    libgthread-2.0.so.0 => /usr/lib/i386-linux-gnu/libgthread-2.0.so.0 (0xb6921000)
    librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xb6918000)
    libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0xb681f000)
    /lib/ld-linux.so.2 (0xb77db000)
    libicudata.so.51 => /home/test/Qt/5.1.1/gcc/lib/libicudata.so.51 (0xb52d6000)
    libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xb5299000)@

    connection code
    @db = new QSqlDatabase();
    db->addDatabase("QMYSQL", "DB");
    db->setHostName("localhost");
    db->setDatabaseName("testdb");
    db->setUserName("testuser");
    db->setPassword("test12");

    qDebug() << "drivers: "<< QSqlDatabase::drivers();
    
    if (db->open())
        qDebug() << "Success!";
    else
        qDebug() << db->lastError().text();@
    

    Error:
    @Starting /home/test/QtProjects/build-MySQLGUI-Desktop_Qt_5_1_0_GCC_32bit-Release/MySQLGUI...
    drivers: ("QSQLITE", "QMYSQL", "QMYSQL3", "QPSQL", "QPSQL7")
    "Driver not loaded Driver not loaded" @

    made copy of file @~/Qt/5.1.1/gcc/plugins/sqldrivers/libqsqlmysql.so@ to project source folder and to build folder. Also created sqldrivers subfolder in project source and build folder and made copy of file @/usr/lib/i386-linux-gnu/libmysqlclient.so@ to this sqldrivers folder.

    What do I do wrong? Why I got error "Driver not loaded Driver not loaded"?

    Pz, any suggestion.


  • Moderators

    I'm closing this topic.

    Duplicate of "this one":http://qt-project.org/forums/viewthread/35641/


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.