1.创建一个新表,结构从旧表来

create table new_table like old_table

2.复制数据到新表

insert into crm_radacct
select * from radacct
where acctstoptime < '2011-11-01 00:00:00'

3.删除旧表的数据

delete from radacct
where acctstoptime < '2011-11-01 00:00:00'

4.清理数据库操作日志

cd /var/lib/mysql
mysql -u root -p
reset master;

5.查看mysql文件夹占用空间大小

du -h --max-depth=1 /var/lib/mysql

6.关闭数据库操作日志选项

vi /etc/my.cnf
注释log-bin=mysql-bin
service mysqld restart