Syntax\n------\n\nSHUTDOWN [WAIT FOR ALL { SLAVES | REPLICAS } ]\n\nDescription\n-----------\n\nThe SHUTDOWN command shuts the server down.\n\nWAIT FOR ALL SLAVES / REPLICAS\n\nThe WAIT FOR ALL REPLICAS statement can be used throughout.\n\nThe WAIT FOR ALL SLAVES option was first added in MariaDB 10.4.4.\n\nWhen a master server is shutdown and it goes through the normal shutdown process, the master kills client threads in random order. By default, the master also considers its binary log dump threads to be regular client threads. As a consequence, the binary log dump threads can be killed while client threads still exist, and this means that data can be written on the master during a normal shutdown that won't be replicated. This is true even if semi-synchronous replication is being used.\n\nThis problem can be solved by shutting down the server with the SHUTDOWN command and by providing the WAIT FOR ALL SLAVES/WAIT FOR ALL REPLICAS option to the command. For example:\n\n``sql\nSHUTDOWN WAIT FOR ALL SLAVES;\n`\n\nWhen the WAIT FOR ALL SLAVES option is provided, the server only kills its binary log dump threads after all client threads have been killed, and it only completes the shutdown after the last binary log has been sent to all connected slaves.\n\nSee Replication Threads: Binary Log Dump Threads and the Shutdown Process for more information.\n\nRequired Permissions\n\nOne must have a SHUTDOWN privilege (see GRANT) to use this command. It is the same privilege one needs to use the mariadb-admin shutdown command.\n\nShutdown for Upgrades\n\nIf you are doing a shutdown to migrate to another major version of MariaDB, please ensure that the innodb_fast_shutdown variable is not 2 (fast crash shutdown). The default of this variable is 1.\n\nExamples\n--------\n\nCREATE EVENT test.shutd`\n    ON SCHEDULE\n        EVERY 1 DAY\n        STARTS '2014-01-01 20:00:00'\n    COMMENT 'Shutdown Maria when the office is closed'\nDO BEGIN\n    SHUTDOWN;\nEND;\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/shutdown