MYSQL删除记录后优化表空间

服务器记录了一些操作日志经常把空间吃满了

select id,send_email,user_email,from_unixtime(send_time) from email_log order by id desc limit 1;

from_unixtime 转换linux格式为可以阅读的格式

删除ID小于20万的数据

delete from email_log where id < 200000;
optimize table email_log


This entry was posted in Linux, 数据库 and tagged . Bookmark the permalink.
月小升QQ 2651044202, 技术交流QQ群 178491360
首发地址:月小升博客https://java-er.com/blog/mysql-delete-clear-space/
无特殊说明,文章均为月小升原创,欢迎转载,转载请注明本文地址,谢谢
您的评论是我写作的动力.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*