Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9184629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:06:05+00:00 2026-06-17T19:06:05+00:00

I have given up on trying to configure the MYSQL driver for the Qt

  • 0

I have given up on trying to configure the MYSQL driver for the Qt 5.0 library, I am going to use the only driver currently available to me – “QSQLITE”.

I have been trying to get this working for quite some time and have tried everything mentioned in similar posts:
Select from SQLite with Qt

QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
db.setHostName(SQL_SERVER);
db.setPort(SQL_PORT);
db.setDatabaseName(SQL_DATABASE);
db.setUserName(SQL_USER);
db.setPassword(SQL_PASS);
bool dbSuccess = db.open();
QList<QString> deviceNames;
QString deviceName;
qDebug() << db;
if(dbSuccess){
    QSqlQuery query;
    qWarning("We made it into the DB");
    query.exec("SELECT device_name FROM tbl_device");
    while (query.next() ){
        qDebug() << query.value(1).toString();
       // deviceNames.append(deviceName);
        //qDebug() << "Test: "<< deviceName;
    }
}
else if(!db.open()){
    qWarning("Database failed to load!");
}

Where SQL_Server = 192.168.1.100

I get the following qDebug output from the application:

QSqlDatabase(driver=""QSQLITE"", database=""homelogic"", host=""hendrenserver"", port=3306, user=""homelogic"",      open=true) 
We made it into the DB

The output suggests that the database connection is valid, however if I change the servername to something completely false such as “xlkcjox” or other random keys – I get the same output. What am I missing here? I feel like this should be relatively easy.

Please advise!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:06:07+00:00Added an answer on June 17, 2026 at 7:06 pm

    When using the sqlite driver for qt, the database name is a file on your disc, regardless of the host name. This is how sqlite works. It needs no host just a filename.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to get Qt X11 cross compiled for PowerPC for a
I have been trying to configure a small website on a Windows Server 2008
I am trying to do ssh connection using cygwin. I have followed instructions given
I'm trying to configure my Rack app to use Memcache for sessions with Rack::Session::Memcache
I have windows 7 (64-bit) and I am trying to configure opencv 2.2 for
I'm really new to Linux environment and I'm trying to use virtualenv I have
I've been trying to configure the user and password for proxy authentication from the
I am trying to configure Xdebug with Eclipse PDT plugin. I have gone through
I have a Windows 2008 server running IIS 7 and I'm trying to configure
I have been trying to query the increase percentage of a product grouped in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.