'MySQL automatically shuts down after one minute on Azure Windows host with Wordpress

I have an Azure App Service with Wordpress and "MySQL In App" meaning that MySQL runs locally on the app host, typically for development purposes.

It's been running fine for months until suddenly a few days ago the server went down. From what I can tell, MySQL has begun shutting down by itself after about a minute of uptime. If I restart the host, Wordpress works fine and reads data from the database. Up till about a minute later when I get an "Internal error". After this point the database is no longer listening to the default port, and I cannot connect to it using e.g. phpmyadmin.

If I look in the process log I find:

2022-05-17T07:59:41.3156056Z
2022-05-17T07:59:41.4253296Z w3wp, pid=6936, tid=5
2022-05-17T07:59:41.4253296Z "D:\Program Files (x86)\mysql\5.7.9.0\bin\mysqld.exe" --console --bind-address=127.0.0.1 --explicit_defaults_for_timestamp --basedir="D:\Program Files (x86)\mysql\5.7.9.0" --datadir="C:\DWASFiles\Sites\syna-wp__ba41\VirtualDirectory0\data\mysql" --port="51025" --tmpdir="D:\local\temp\mysql" --innodb_temp_data_file_path="..\..\..\temp\mysql\ibtmp1:12M:autoextend" --pid-file="D:\local\temp\mysql\RD0050F2A3C539.pid" --general_log=1 --general_log_file="C:\DWASFiles\Sites\syna-wp__ba41\VirtualDirectory0\LogFiles\mysql\MySql-2022-05-17T07-59-41-39531Z-RD0050F2A3C539-general.log" 
2022-05-17T07:59:52.3317558Z mysqld:5268 started
2022-05-17T07:59:53.380389Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2022-05-17T07:59:53.380389Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2022-05-17T07:59:53.380389Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2022-05-17T07:59:53.380389Z 0 [ERROR] Cannot open Windows EventLog; check privileges, or start server with --log_syslog=0
2022-05-17T07:59:53.380389Z 0 [Note] D:\Program Files (x86)\mysql\5.7.9.0\bin\mysqld.exe (mysqld 5.7.9-log) starting as process 5268 ...
2022-05-17T07:59:53.460415Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2022-05-17T07:59:53.460415Z 0 [Note] InnoDB: Uses event mutexes
2022-05-17T07:59:53.460415Z 0 [Note] InnoDB: Memory barrier is not used
2022-05-17T07:59:53.460415Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2022-05-17T07:59:53.460415Z 0 [Note] InnoDB: Number of pools: 1
2022-05-17T07:59:53.460415Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2022-05-17T07:59:53.644321Z 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2022-05-17T07:59:53.692034Z 0 [Note] InnoDB: Completed initialization of buffer pool
2022-05-17T07:59:57.396185Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2022-05-17T08:00:09.647126Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-05-17T08:00:09.832645Z 0 [Note] InnoDB: Setting file '..\..\..\temp\mysql\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-05-17T08:00:12.192143Z 0 [Note] InnoDB: File '..\..\..\temp\mysql\ibtmp1' size is now 12 MB.
2022-05-17T08:00:12.210914Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2022-05-17T08:00:12.210914Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2022-05-17T08:00:12.210914Z 0 [Note] InnoDB: Waiting for purge to start
2022-05-17T08:00:12.442153Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 18390ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2022-05-17T08:00:12.570955Z 0 [Note] InnoDB: 5.7.9 started; log sequence number 1319484727
2022-05-17T08:00:12.582786Z 0 [Note] Plugin 'FEDERATED' is disabled.
2022-05-17T08:00:12.582786Z 0 [Note] InnoDB: not started
2022-05-17T08:00:12.600958Z 0 [Note] InnoDB: Loading buffer pool(s) from C:\DWASFiles\Sites\syna-wp__ba41\VirtualDirectory0\data\mysql\ib_buffer_pool
2022-05-17T08:00:13.912099Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2022-05-17T08:00:13.912099Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 51025
2022-05-17T08:00:13.932142Z 0 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2022-05-17T08:00:13.932142Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2022-05-17T08:00:15.260212Z 0 [Note] InnoDB: Buffer pool(s) load completed at 220517  8:00:15
2022-05-17T08:00:17.145513Z 0 [Note] Event Scheduler: Loaded 0 events
2022-05-17T08:00:17.145513Z 0 [Note] D:\Program Files (x86)\mysql\5.7.9.0\bin\mysqld.exe: ready for connections.
Version: '5.7.9-log'  socket: ''  port: 51025  MySQL Community Server (GPL)
2022-05-17T08:00:17.1455134Z mysqld(5268) is ready at port 51025!
2022-05-17T08:01:33.546565Z 0 [Note] D:\Program Files (x86)\mysql\5.7.9.0\bin\mysqld.exe: Normal shutdown

2022-05-17T08:01:33.546565Z 0 [Note] Giving 0 client threads a chance to die gracefully
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down slave threads
2022-05-17T08:01:33.546565Z 0 [Note] Forcefully disconnecting 0 remaining clients
2022-05-17T08:01:33.546565Z 0 [Note] Event Scheduler: Purging the queue. 0 events
2022-05-17T08:01:33.546565Z 0 [Note] Binlog end
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'ngram'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'partition'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'ARCHIVE'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'MyISAM'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2022-05-17T08:01:33.546565Z 0 [Note] Shutting down plugin 'InnoDB'
2022-05-17T08:01:33.546565Z 0 [Note] InnoDB: FTS optimize thread exiting.
2022-05-17T08:01:33.559155Z 0 [Note] InnoDB: Starting shutdown...
2022-05-17T08:01:33.716650Z 0 [Note] InnoDB: Dumping buffer pool(s) to C:\DWASFiles\Sites\syna-wp__ba41\VirtualDirectory0\data\mysql\ib_buffer_pool
2022-05-17T08:01:33.762302Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 220517  8:01:33
2022-05-17T08:01:34.438482Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1319485121
2022-05-17T08:01:34.438482Z 0 [Note] InnoDB: Removed temporary tablespace data file: "..\..\..\temp\mysql\ibtmp1"
2022-05-17T08:01:34.438482Z 0 [Note] Shutting down plugin 'MEMORY'
2022-05-17T08:01:34.438482Z 0 [Note] Shutting down plugin 'CSV'
2022-05-17T08:01:34.438482Z 0 [Note] Shutting down plugin 'sha256_password'
2022-05-17T08:01:34.438482Z 0 [Note] Shutting down plugin 'mysql_native_password'
2022-05-17T08:01:34.438482Z 0 [Note] Shutting down plugin 'binlog'
2022-05-17T08:01:34.469734Z 0 [Note] D:\Program Files (x86)\mysql\5.7.9.0\bin\mysqld.exe: Shutdown complete

I'm not understanding all of the warnings and I'm not sure if they could matter in this case. I suppose the certificate warnings do not matter.

But this is a successful boot: 2022-05-17T08:00:17.145513Z 0 [Note] D:\Program Files (x86)\mysql\5.7.9.0\bin\mysqld.exe: ready for connections.

And this is the shutdown: 2022-05-17T08:01:33.546565Z 0 [Note] D:\Program Files (x86)\mysql\5.7.9.0\bin\mysqld.exe: Normal shutdown

What is going on here.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source