From: Michael Widenius Date: April 17 1999 8:20am Subject: Log file List-Archive: http://lists.mysql.com/mysql/1975 Message-Id: <14104.17436.155039.111800@monty.pp.sci.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit >>>>> "Chai-Hup" == Chai-Hup Chen writes: Chai-Hup> Hi, Chai-Hup> The log file under /db_dir/mysql/var/my_host.log may grow to be very Chai-Hup> huge (>1G each week in my case), which is too big to be read. Chai-Hup> Since I have a live system, I can't use a script to remove the log file, Chai-Hup> shutdown and restart mysqld. Any way that I can keep the log file in a Chai-Hup> readable size? Hi! I just added the following entry to the MySQL manual. Hope it helps: ------ Log file maintenance ==================== When using *MySQL* with log files, you will from time to time want to remove/backup old log files and tell *MySQL* to start logging on new files. *Note Update log:: One a Linux (`Redhat') installation, you can use the `mysql-log-rotate' script for this. If you installed `MySQL' from an RPM distribution, the script should have been installed automaticly. On other systems you must yourself install a short script that you start from `cron' to handle log files. You can force `MySQL' to start using new log files by using `mysqladmin flush-logs' or by using the SQL command `FLUSH LOGS'. The above command does the following: * If standard logging (`--log') is used, closes and reopens the log file. (`mysql.log' as default). * If update logging (`--log-update') is used, closes the update log and opens a new log file with a higher sequence number. If you only are using an update log, you only have to flush the logs and then move away the old update log files to a backup. If you are using the normal logging, you can do something like: cd mysql-data-directory mv mysql.log mysql.old mysqladmin flush-tables and then take a backup and remove `mysql.old'. ------------------