Home > OS >  is there a way of hosting a mysql database using only Qt?
is there a way of hosting a mysql database using only Qt?

Time:05-13

I am trying to make a program that connect many computers into a local MySQL database hosted by a central computer, but the way I found to host a MySQL database is using an External program as Xampp or WampServer. I am Wodering if I can host a MySQL database using only Qt's classes like QTcpServer without the needing of external programs.

CodePudding user response:

No. MySQL needs a MySQL Server process to manage connections, permissions, SQL parsing, storage engines, caching, etc. You can't use a MySQL database without a MySQL Server.

You might like to explore using SQLite, which is a free embedded database that can be used without requiring a separate daemon process. SQLite is a different product than MySQL, so there will be differences in its implementation of some SQL language features. Be sure to study the SQLite documentation: https://sqlite.org/docs.html

I did a quick Google search (my search phrase was "qt with sqlite") and I found numerous blogs and tutorials about how to use SQLite in an application with Qt. Here's just the first result, but there are others: https://katecpp.github.io/sqlite-with-qt/

  • Related