magento 数据库常用语句

本文提供了针对Magento平台的一系列数据库管理技巧,包括检查重复产品、批量更新产品选项、清理不必要的数据库记录等操作,有助于提高网站性能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

mysql查看网站是否有重复产品语句

select value,count(*) from `catalog_product_entity_varchar`
where entity_type_id=4 and attribute_id in
(select attribute_id from `eav_attribute` where entity_type_id=4 and attribute_code='name')
group by value
having count(*)>1



短描述里加内容
update catalog_product_entity_text set value= concat(value,'text') where attribute_id =65 



magento 批量改自定义选项是否必选

UPDATE `catalog_product_option` SET is_require=0 WHERE product_id IN (SELECT entity_id FROM `catalog_product_entity` )



数据库瘦身
truncate dataflow_batch_export;
truncate dataflow_batch_import;
truncate log_customer;
truncate log_quote;
truncate log_summary;
truncate log_summary_type;

truncate log_url;
truncate log_url_info;
truncate log_visitor;
truncate log_visitor_info;
truncate log_visitor_online;

truncate report_viewed_product_index;
truncate report_compared_product_index;
truncate report_event;
     
set foreign_key_checks = 0;
truncate index_process_event;
truncate index_event;
set foreign_key_checks = 1;
TRUNCATE `core_url_rewrite`;



批量清空自定义选项
truncate table catalog_product_option
truncate table catalog_product_option_title
truncate table catalog_product_option_type_title
truncate table catalog_product_option_type_value
truncate table catalog_product_option_type_price 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值