我们的使命

助力跨境卖家高效建立全球销售网络

喜报2021年我司获《江苏省国家高新技术企业》认定

分类目录

文章标签

热门推荐

相关咨讯

opencart批量,magento数据库清理

2022-10-31 10:53:28 - 米境通跨境电商

    

    随着Magento网站访问量的增加,Magento数据库也越来越大了,甚至有几个G,直接后果:

    1.影响网站和数据库性能;

    2.备份/恢复数据库花费的时间增加了;

    3.占用磁盘空间;

    4.出现一些设置产品不显示的问题

    Magento数据库迅速膨胀,主要是由于一些日志数据的剧增,可以通过Magento自身的cron定时清理日志。

    另外一种又快又好的办法是执行SQL清理(请先备份下数据库,以免出错),如下:

    truncatedataflow_batch_export;

    truncatedataflow_batch_import;

    truncatelog_customer;

    truncatelog_quote;

    truncatelog_summary;

    truncatelog_summary_type;

    truncatelog_url;

    truncatelog_url_info;

    truncatelog_visitor;

    truncatelog_visitor_info;

    truncatelog_visitor_online;

    truncatereport_viewed_product_index;

    truncatereport_compared_product_index;

    truncatereport_event;

    setforeign_key_checks=0;

    truncateindex_process_event;

    truncateindex_event;

    setforeign_key_checks=1;

    解决了上述问题,我们要怎么样可以避免数据库日志的增加呢?

    我们可以设置magento自动清空log,方法如下:

    1)登录你的magento后台进入System->Configuration

    2)在左栏进入Advanced->System

    3)打开LogCleaning

    4)设置“savelog,days”到一个数值,这个的单位是天,我觉得几天清空一次就好了

    5)设置激活自动清空log设置

    如下图为设置每天自动清空我的magento数据库log。这里清理的时间段还是比较少人访问的时候,可以节省服务器的开销,然后是可以避免前台在线客户的一些数据产生异常。
    联系我们
  • 24H客服
  • 联系电话:16651690460(龙经理)
  • 微信咨询:
南京天遥路联网络科技有限公司,版权所有 Copyright By ©米境通ERP4.0,2015-2025,苏ICP备:苏ICP备15044100号-2, 苏公网安备:32011402011043