Database Connection

In the previous chapter, we learned how to create a login page from scratch. However, it is not functional yet, as the login page is not connected to a database. In this chapter, you will learn how to connect your Qt application to a MySQL (or MariaDB) database that validates login credentials.

In this chapter, we will cover the following topics:

  • Introducing the MySQL database system
  • Setting up the MySQL database
  • SQL commands
  • Database connection in Qt
  • Functional login page

We will walk through this chapter in a step-by-step approach to discover the powerful features that come with Qt and allow your application to connect directly to a database without any additional third-party dependencies. Database querying is a huge ...

Get Hands-On GUI Programming with C++ and Qt5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.