Results 1 to 2 of 2

Thread: MySQL Login?

  1. #1
    Join Date
    Mar 2011
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Exclamation MySQL Login?

    I am trying to do a MySQL login. The connection.open() is returning false with correct details...

    Qt Code:
    1. QSqlDatabase connection = QSqlDatabase::addDatabase("QMYSQL");
    2. connection.setHostName(host);
    3. connection.setUserName(username);
    4. connection.setPassword(password);
    5. connection.setDatabaseName(database);
    6. connection.setPort(3306);
    7.  
    8. if(connection.open())
    9. // Load program...
    To copy to clipboard, switch view to plain text mode 

    Some help would be great!

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: MySQL Login?

    What does connection.isValid() return ?
    Does QSqlDatabase::drivers contain "QMYSQL" ? In other words, do you have MySql plugin ?

Similar Threads

  1. Login Form in QT
    By panyang in forum Newbie
    Replies: 9
    Last Post: 29th January 2011, 05:41
  2. How to Login using QNetworkAccessManager?
    By cydside in forum Newbie
    Replies: 1
    Last Post: 31st August 2009, 21:41
  3. Login Problem
    By srichand in forum Qt Programming
    Replies: 1
    Last Post: 9th May 2008, 12:37

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