Solved 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):- 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.
- Every CRM user has its own MySQL user. Launching application, every user must enter his mysql login/password
- 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.
- Something else
-
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 :)