一,mysqladmin使用flush-logs的文档:
mysql8官网上面针对mysqladmin的文档地址
https://dev.mysql.com/doc/refman/8.0/en/mysqladmin.html
内容:
flush-logs [log_type ...]
Flush all logs.
The mysqladmin flush-logs command permits optional log types to be given, to specify which logs to flush. Following the flush-logs command,
you can provide a space-separated list of one or more of the following log types: binary, engine, error, general, relay, slow.
These correspond to the log types that can be specified for the FLUSH LOGS SQL statement.
说明: flush-logs 加 error binary slow 等参数,这个功能点是在mysql5.7版本后才增加的,
更低版本的mysql应该不支持这个参数,一定要注意
说明:作者:刘宏缔 邮箱: 371125307@qq.com
二,创建日志分割后目录
[root@yjweb logs]$ mkdir mysqllogsbackup
三,编写脚本
[root@yjweb crontab]# vi split_mysql_logs.sh
内容:</