nixsap icon indicating copy to clipboard operation
nixsap copied to clipboard

mariadb: change some options without restart

Open ip1981 opened this issue 8 years ago • 0 comments

Changing some options without restart can be done in this way:

  1. Mark dynamic options as such (from MariaDB docs).
  2. Put them into separate file, link that file to something like /etc/mariadb.cnf, instead of the global file.
  3. Include that file in the global file.
  4. Make a service which applies dynamic option changes to running MariaDB.
  5. When MariaDB restarts, it will get all options from the global file and from /etc/mariadb.cnf.

For MariaDB >= 10.1:

SELECT LOWER(VARIABLE_NAME)
FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES
WHERE READ_ONLY = 'NO'
AND VARIABLE_SCOPE != 'SESSION ONLY'
ORDER BY VARIABLE_NAME;

To Nix list:

SET group_concat_max_len = 10000;
SELECT GROUP_CONCAT(
  CONCAT('"', LOWER(VARIABLE_NAME), '"')
  ORDER BY VARIABLE_NAME SEPARATOR ' '
) FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES
WHERE READ_ONLY = 'NO'
AND VARIABLE_SCOPE != 'SESSION ONLY'\G

ip1981 avatar May 18 '17 19:05 ip1981