I have a very long-running HeiSQL instance that stays up for weeks. I am setting the time_zone variable in a startup.sql script. However sometimes, usually on the first connection of the morning after having timed out its connection overnight, I am finding that my startup.sql isn't being executed:
/* Connection to 127.0.0.1 closed at 2015-12-17 11:25:07 */
/* Connecting to 127.0.0.1 via MySQL (TCP/IP), username vSimLauncher, using password: Yes ... */
SELECT CONNECTION_ID();
/* Connected. Thread-ID: 16 */
/* Unknown character set: 'utf8mb4' */
/* Characterset: utf8 */
SHOW STATUS;
SHOW VARIABLES;
USE `vsimlauncher`;
SHOW DATABASES;
SELECT `DEFAULT_COLLATION_NAME` FROM `information_schema`.`SCHEMATA` WHERE `SCHEMA_NAME`='vsimlauncher';
SHOW TABLE STATUS FROM `vsimlauncher`;
SHOW FUNCTION STATUS WHERE `Db`='vsimlauncher';
SHOW PROCEDURE STATUS WHERE `Db`='vsimlauncher';
SHOW TRIGGERS FROM `vsimlauncher`;
SELECT `DEFAULT_COLLATION_NAME` FROM `information_schema`.`SCHEMATA` WHERE `SCHEMA_NAME`='information_schema';
SHOW TABLE STATUS FROM `information_schema`;
SHOW FUNCTION STATUS WHERE `Db`='information_schema';
SHOW PROCEDURE STATUS WHERE `Db`='information_schema';
SHOW TRIGGERS FROM `information_schema`;
SHOW EVENTS FROM `information_schema`;
SELECT *, EVENT_SCHEMA AS `Db`, EVENT_NAME AS `Name` FROM information_schema.`EVENTS` WHERE `EVENT_SCHEMA`='vsimlauncher';
SHOW CREATE TABLE `vsimlauncher`.`ports`;
SHOW COLLATION;
/* Entering session "vSimLauncher" */
SELECT `id`, `vm_guest_id`, `vm_guest_port`, `dynamic`, `port_in_use`, `reserved`, `course_id`, `course_instance`, `vsim_id`, `vsim_port_num`, `start_datetime`, `runid`, `pid`, `browsing`, `healthy_datetime` FROM `vsimlauncher`.`ports` ORDER BY `vm_guest_id` ASC, `vm_guest_port` ASC LIMIT 1000;
SHOW CREATE TABLE `vsimlauncher`.`ports`;
SELECT `id`, `vm_guest_id`, `vm_guest_port`, `dynamic`, `port_in_use`, `reserved`, `course_id`, `course_instance`, `vsim_id`, `vsim_port_num`, `start_datetime`, `runid`, `pid`, `browsing`, `healthy_datetime` FROM `vsimlauncher`.`ports` ORDER BY `vm_guest_id` ASC, `vm_guest_port` ASC LIMIT 1000;
SHOW CREATE TABLE `vsimlauncher`.`ports`;
SELECT `id`, `vm_guest_id`, `vm_guest_port`, `dynamic`, `port_in_use`, `reserved`, `course_id`, `course_instance`, `vsim_id`, `vsim_port_num`, `start_datetime`, `runid`, `pid`, `browsing`, `healthy_datetime` FROM `vsimlauncher`.`ports` ORDER BY `vm_guest_id` ASC, `vm_guest_port` ASC LIMIT 1000;
SHOW CREATE TABLE `vsimlauncher`.`ports`;
SELECT `id`, `vm_guest_id`, `vm_guest_port`, `dynamic`, `port_in_use`, `reserved`, `course_id`, `course_instance`, `vsim_id`, `vsim_port_num`, `start_datetime`, `runid`, `pid`, `browsing`, `healthy_datetime` FROM `vsimlauncher`.`ports` ORDER BY `vm_guest_id` ASC, `vm_guest_port` ASC LIMIT 1000;
SHOW CREATE TABLE `vsimlauncher`.`ports`;
I haven't been able to isolate the cases where it does and doesn't work. It may be related to the fact that I have 'automatically reconnect to last used sessions on startup' enabled.