Mysql

init_file: Run SQL file on startup

Add the following paramter to the [mysqld] or [mariadb] section of your my.cnf file (depending on the OS, at /etc/mysql/my.cnf, /etc/my.cnf, other path):

Add the following paramter to the [mysqld] or [mariadb] section of your my.cnf file (depending on the OS, at /etc/mysql/my.cnf, /etc/my.cnf, other path):

init_file = /etc/mysql/init.sql

The /etc/mysql/init.sql file can contain "any" SQL queries.

Example to enable/ install the MariaDB Query Response Time Plugin plugin:

INSTALL SONAME 'query_response_time';

SET GLOBAL query_response_time_stats = 1;
SET GLOBAL query_response_time_flush = 1;
Note: There are other ways to install the plugin, but to "initially" flush the plugin's data the SET GLOBAL query_response_time_ can be useful to be run.

References