Types of Connection Settings
There are 2 types of connection settings:
- GLOBAL Level: The settings will apply to every client connected with your MySQL Server instance. Its scope is global. Global settings affect the performance, stability & security of the overall server.
- SESSION Level: The session-level settings apply only to the current session. Every client application can have its current session. The changes will only affect for however long the connection lasts.
Connection Timeout with MySQL Database
The management of connection timeout is one of the most important aspects when working in client-server architecture in MySQL. A connection timeout can be defined as the duration of time for which a client waits expecting a response from the server before a connection is considered ‘unsuccessful‘.
When working with MySQL it becomes crucial to manage this setting. The client may keep facing the connection timeout issue which will lead to bad performance, unnecessary resource consumption & instability. To prevent this, we have to re-configure & increase the ‘wait_timeout’ or ‘interactive_timeout‘ settings in the MySQL Database.