The linux server that has been running for four months and has not been stopped went on strike today. After looking for many reasons, I found that the disk was used up and df-h was used, du-h-max-depth = 1 one by one search, I found that it is the space occupied by the mysql/data/mysql-bin.0000X file, I deleted it directly with rm, as a result, the data on the station was lost. Fortunately, there was a backup. In retrospect, the method is incorrect. The correct method is found. I hope you will not take a detour.
Found so many mysql-bin.0000X files, what is this? It turns out this is the mysql operation log file. I only have dozens of M databases, and the operation log is 3 GB in size. How do I delete mysql-bin.0000X log files? Red indicates the input command. [root @ jiucool var] #/usr/local/mysql/bin/mysql-u root-p Enter password: (Enter the password) Welcome to the MySQL monitor. commands end with; or \ g. your MySQL connection id is 264001 Server version: 5.1.35-log Source distribution Type 'help; 'or' \ H' for help. type '\ C' to clear the current input statement. mysql> reset master; (clear log files) Query OK, 0 rows affected (8.51 sec) mysql> OK, let's check the mysql file. How much space does the folder occupy? [Root @ jiucool var] # du-h-max-depth = 1/usr/local/mysql/37 M/usr/local/mysql/var 70 M/usr/local/ mysql/mysql-test 15 M/usr/local/mysql/lib 448 K/usr/local/mysql/include 2.9 M/usr/local/mysql/share 7.6 M/usr/ local/mysql/libexec 17 M/usr/local/mysql/bin 11 M/usr/local/mysql/docs 2.9 M/usr/local/mysql/SQL-runtime 163 M/ usr/local/mysql/is ready, take a look, the entire mysql directory occupies 16 m size! OK, no problem, since the mysql-bin.0000X Log File occupies such a large space, the significance of existence is not particularly large, so we won't let it generate it. [Root @ jiucool var] # find/-name my. cnf found my. cnf is the mysql configuration file. Comment out log-bin = mysql-bin. # Replication Master Server (default) # binary logging is required for replication # log-bin = mysql-bin restart MySQL