Important: Please read the Qt Code of Conduct -

Best practices for mysql application in QT

  • I am beginner starting to learn QT. Help me, please.
    What is the best practice to create a multi-user QT desktop application with remote MySQL (for example CRM for 10 users):

    1. One mysql user with login/password stored in an encrypted file. Desktop QT application decrypts the file in memory and connects to MySQL through internet.
    2. Every CRM user has its own MySQL user. Launching application, every user must enter his mysql login/password
    3. Desktop QT application connects, through internet, to server developed also in QT, which selects data from MySQL database, serializes result-set variable and sends it back to destkop QT app. I don't know if this way is possible in QT.
    4. Something else

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    First thing do not ever expose a database on internet. That's a call to get hacked.

    Your further idea is better: create a proper REST service for the interactions between your application and the database. You can stay with Qt by using the Cutelyst project.

    As for your users, there are several possibilities. One of which is to use a token that has to be refreshed after some time being not used. Your users should provide a user name and password to start and then your application gets a token to continue to operate. If the user does not do anything after some timeout, the token becomes invalid and then the user should be prompted again for its credentials.

  • SGaist, you directed me to the right way. Thank you a lot :)

Log in to reply