A really convenient feature in MySQL 8.0 is the ability to persist the values of global variables across server restarts, without writing them into an options file. This was developed primarily for the benefit of Cloud installations of MySQL, but is very handy for a DBA in on-premise installations too.
To use this feature you need to have the SYSTEM_VARIABLES_ADMIN and PERSIST_RO_VARIABLES_ADMIN privileges.
To demonstrate, we'll increase the value of the max_connections system variable from its default of 151 to 152 and then restart the MySQL server to check that MySQL remembers the new value.
mysql> SHOW GLOBAL VARIABLES LIKE 'max_connections'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | max_connections | 151 | +-----------------+-------+ 1 row in set (#.## sec)
Use SET PERSIST to persist the change that we're about to make:
mysql> SET PERSIST max_connections …
[Read more]