Results 1 to 8 of 8

Thread: MySQL driver - Very strange problem. PLEASE HELP ME. Thanks.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    May 2009
    Posts
    28
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: MySQL driver - Very strange problem. PLEASE HELP ME. Thanks.

    After making pluin. I made 3 simple files for my example
    But now it sitll dont run.
    Please help me discover this problem

    B.Pro file (Project name is B):
    QT += sql
    TARGET = B
    TEMPLATE = app
    SOURCES += main.cpp\
    mainwindow.cpp
    HEADERS += mainwindow.h
    FORMS += mainwindow.ui

    main.cpp :

    #include <QtGui/QApplication>
    #include "mainwindow.h"
    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    return a.exec();
    }

    MainWindow.cpp

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <QtSql>
    MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    createConnection();
    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }
    void MainWindow::createConnection()
    {
    QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
    db.setHostName("127.0.0.13");
    db.setDatabaseName("ytr");
    db.setUserName("root");
    db.setPassword("d5aquE");
    }
    It still appears a message to me that:
    QMYSQL driver not loaded
    Thanks so much.
    Last edited by diego; 8th June 2009 at 08:04.

Similar Threads

  1. Replies: 4
    Last Post: 10th November 2009, 19:48
  2. A strange problem with QGraphicsSvgItem
    By Justin_W in forum Qt Programming
    Replies: 6
    Last Post: 23rd July 2008, 09:40
  3. My Mysql 5 and Qt 4.2.2 Problem (Driver not loaded)
    By fengtian.we in forum Qt Programming
    Replies: 4
    Last Post: 9th February 2007, 08:11
  4. MySql plugin driver issues
    By stevey in forum Installation and Deployment
    Replies: 11
    Last Post: 20th September 2006, 13:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.