Results 1 to 11 of 11

Thread: How to connect Qt with MYSQL??

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    10
    Thanked 13 Times in 12 Posts

    Default Re: How to connect Qt with MYSQL??

    Anybody there to help me... Am using the following code. It is not connected..

    Qt Code:
    1. QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
    2. db.setHostName("localhost");
    3. db.setDatabaseName("Qt");
    4. db.setUserName("root");
    5. db.setPassword("1");
    6. bool ok=false;
    7. ok=db.open();
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 18th March 2011 at 12:49.

Similar Threads

  1. qt connect with mysql in fedora
    By sachinmcajnu in forum Qt Programming
    Replies: 1
    Last Post: 10th March 2011, 19:01
  2. Mysql unknown database, QMYSQL unable to connect
    By lixo1 in forum Qt Programming
    Replies: 3
    Last Post: 14th July 2010, 21:39
  3. Qt connect different MySQL
    By weixj2003ld in forum Qt Programming
    Replies: 0
    Last Post: 5th August 2009, 08:35
  4. How to connect MySQL with QT
    By diego in forum Qt Programming
    Replies: 0
    Last Post: 27th May 2009, 05:34
  5. VS2005+Qt4.2.2:Get a Mysql connect error.HELP!!
    By fengtian.we in forum Qt Programming
    Replies: 2
    Last Post: 20th May 2007, 12:23

Tags for this Thread

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.