1. What are the MySQL log files on the master server?
View by command:
Show binary logs;
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/85/45/wKioL1ee4Bqi9Zz0AAAwuxXkZk0315.png-wh_500x0-wm_3 -wmp_4-s_6781112.png "title=" 1.png "alt=" Wkiol1ee4bqi9zz0aaawuxxkzk0315.png-wh_50 "/>
2. View the binary logs used by the synchronization from the server.
With the command:show slave status\g
, mysql-tb-bin.000005 This log file is in use.
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/85/44/wKiom1ee4NCCcrr3AADg6mDs6mk384.png-wh_500x0-wm_3 -wmp_4-s_158250329.png "style=" Float:none; "title=" 2.png "alt=" Wkiom1ee4ncccrr3aadg6mds6mk384.png-wh_50 "/>
3, back to the primary server, start to clean up the log, but can not clean up the mysql-tb-bin.000005 log file,
With command:purge binary logs to ' mysql-tb-bin.000005 ';
This command is to clean up the binary logs except mysql-tb-bin.000005;
After successful execution, view the binary log list: show binary logs;
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/85/44/wKiom1ee4NDg2bXWAAAafy-UiIY311.png-wh_500x0-wm_3 -wmp_4-s_1662411719.png "style=" Float:none; "title=" 3.png "alt=" Wkiom1ee4ndg2bxwaaaafy-uiiy311.png-wh_50 "/>
Cleanup succeeds, but the manual cleanup is dangerous and manual cleanup is done manually.
Can be added in My.ini:
Expire_logs_days=5
The purpose of this configuration is that MySQL will automatically clean up logs that expire for 5 days
This article is from the "Wang Liming" blog, make sure to keep this source http://80cto.blog.51cto.com/7503144/1832996
MySQL Database cleanup System log (cleanup for master-slave replication primary server)