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 7642717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:15:39+00:00 2026-05-31T09:15:39+00:00

In my experience: the way to access mysql’s database , i should access mysql-server

  • 0

In my experience: the way to access mysql’s database , i should access mysql-server firstly and then access database..But if want to access sqlite’s database, i can access database file directly , just by a file(.db), so easy..

My question: can i access mysql database like sqlite ? Thank you!

The way to access mysql as follow:

QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("localhost");
db.setDatabaseName("demo"); 
db.setUserName("root"); 
db.setPassword("root1");

if(db.open()) {
    qDebug("Make it");
} else {
    qDebug("Sorry");
}

the way to access sqlite as follow:

db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName("chat.db");
  • 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-05-31T09:15:41+00:00Added an answer on May 31, 2026 at 9:15 am

    In your particular position you cannot access it in the same manner. As Adrian mentioned, SQL Lite is an embedded database, meaning it authenticates differently from a server-client model of MySQL.

    Because the MySQL database is not local to the device, you must then use a MySQL user to connect to it. Otherwise, you pose a large security risk, as anyone with the server information could connect using the same string you’d want to connect with.

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

Sidebar

Related Questions

I have some experience in ASP.Net and can work my way around it without
My experience with MySQL is very basic. The simple stuff is easy enough, but
I want to access the vector in the manipulatevector function below the same way
Is there a way to read a file's data but continue reading the data
I'm quite new to Microsoft SQL Server. I have some experience with MySQL, and
Has anyone had any experience targetting WSH in the way that VBScript , JScript
whats the best way to export a Datagrid to excel? I have no experience
So, in your experience, whats the best way? Is there a secure way that's
Notice how Firebug can access the DOM of cross domain iframes and even allow
A quick preface, I'm very comfortable in .Net, but have limited experience in c++,

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.