Syntax\n------\n\nPURGE { BINARY | MASTER } LOGS\n    { TO 'log_name' | BEFORE datetime_expr }\n\nDescription\n-----------\n\nThe PURGE BINARY LOGS statement deletes all the binary log files listed in the log index file prior to the specified log file name ordate. BINARY and MASTER are synonyms.Deleted log files also are removed from the list recorded in the index file, sothat the given log file becomes the first in the list.\n\nThe datetime expression is in the format 'YYYY-MM-DD hh:mm:ss'.\n\nIf a slave is active but has yet to read from a binary log file you attempt to delete, the statement will fail with an error. However, if the slave is not connected and has yet to read from a log file you delete, the file will be deleted, but the slave will be unable to continue replicating once it connects again.\n\nThis statement has no effect if the server was not started with the --log-bin option to enable binary logging.\n\nTo list the binary log files on the server, use SHOW BINARY LOGS. To see which files they are reading, use SHOW SLAVE STATUS. You can only delete the files that are older than the oldest file that is used by the slaves.\n\nTo list the binary log files on the server, use SHOW BINARY LOGS. To see which files they are reading, use SHOW SLAVE STATUS. You can only delete the files that are older than the oldest file that is used by the slaves.\n\nTo delete all binary log files, use RESET MASTER.To move to a new log file (for example if you want to remove the current log file), use FLUSH LOGS before you execute PURGE LOGS.\n\nIf the expire_logs_days server system variable is not set to 0, the server automatically deletes binary log files after the given number of days. From MariaDB 10.6, the binlog_expire_logs_seconds variable allows more precise control over binlog deletion, and takes precedence if both are non-zero.\n\nRequires the BINLOG ADMIN privilege.\n\nRequires the SUPER privilege.\n\nExamples\n--------\n\nPURGE BINARY LOGS TO 'mariadb-bin.000063';\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/purge-binary-logs