I have contracted a VPS where I have a mysql database to use my application made in Delphi.
The fact is that I already have it configured, in fact I can open the data base from any manager. But when my app is opened in Delphi, a desktop application, before any update or insert a message appears:
MySQL Server has gone away.
The thing is that I work with TClientDataSet, and with the local database it didn't give that error. I don't know what configuration of my server I should modify.
What is surely happening is that the MySQL defualt configuration is dropping connections that have been idle for some time. For a desktop app, you might want to increase this time to much higher values than it currently has
Run the following command on the server:
It will return something like
They are of particular interest
interactive_timeout
andwait_timeout
.You can change their values with the command
set global
, for example:More information in the documentation:
That said, since the server is remote, I would also recommend you to implement some reconnection mechanism to your application, so that the user doesn't always lose their work if the internet connection is lost while processing some record.