Results 1 to 2 of 2

Thread: Qt/MySQL(WAMP)

  1. #1
    Join Date
    Mar 2012
    Posts
    14
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt/MySQL(WAMP)

    Hi,

    Considering that WAMP is installed, and trying to use the MySQL (from WAMP) with Qt/SQL. The following code lead to an error:
    Qt Code:
    1. QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
    2. db.setHostName("localhost");
    3. db.setDatabaseName("mydb");
    4. db.setUserName("root");
    5. db.setPassword("");
    6. bool ok = db.open();
    7. QSqlError error = db.lastError();
    To copy to clipboard, switch view to plain text mode 
    The error is "Driver not loaded" .

    One solution is to install another SQL.

    Is it possible to solve this without additional installations, so the already installed MySQL could be used?

    Thanks for the attention.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Qt/MySQL(WAMP)

    Quote Originally Posted by cstr View Post
    One solution is to install another SQL.
    No, you can just install the development files.

    When using MinGW you have to build the driver yourself. The tutorial looks good at a brief look.

Similar Threads

  1. Qt + Mysql on Mac OS X
    By P4ulo in forum Qt Programming
    Replies: 7
    Last Post: 12th February 2012, 00:34
  2. I need MySQL driver for Qt 4.6, WindowsXP(32), MySQL 5.1
    By User_3 in forum Installation and Deployment
    Replies: 7
    Last Post: 15th October 2010, 15:19
  3. mysql
    By zenon in forum Qt Programming
    Replies: 1
    Last Post: 9th June 2009, 06:49
  4. MySQL on Qt4
    By ^NyAw^ in forum Qt Programming
    Replies: 4
    Last Post: 10th April 2008, 16:12
  5. MYSQL 5 Table qt model as small Mysql admin
    By patrik08 in forum Qt-based Software
    Replies: 0
    Last Post: 1st May 2007, 09:43

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.