Over time the database is getting bigger with Magento. Among other things, this is often at the log files, written automatically by system. These can be maintained on a variety of ways or. be maintained.
But who wants to quickly delete all the time log files, e.g. by. to shrink the database, This can quickly do a SQL command in.
For this purpose, e.g.. go into PHPMyAdmin, the concrete and then select the DB tab “SQL” click. Then enter this data into the window
TRUNCATE TABLE log_customer; TRUNCATE TABLE log_quote; TRUNCATE TABLE log_summary; TRUNCATE TABLE log_summary_type; TRUNCATE TABLE log_url; TRUNCATE TABLE log_url_info; TRUNCATE TABLE log_visitor; TRUNCATE TABLE log_visitor_info; TRUNCATE TABLE log_visitor_online;
and click OK. The log data is then deleted.
Used in Magento versions 1.4.1.1 and 1.5.1.0 Comments? Additions? Notes? Gladly!
Addendum dated 11.11.2013
In the version 1.7.0.2 I use this command currently:
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; TRUNCATE index_event; TRUNCATE catalog_compare_item;
Hallo,
can I change the SQL query to 1.7.x for 1.8.0.1 use?
Regards
I have just tried it once at our 1.8.1.0er Test Store. The index_event only had a problem with the line TRUNCATE;. However, this also did not hurt. Is this case only an error message after the SQL command: #1701 – Cannot truncate a table referenced in a foreign key constraint (`testshop`.`index_process_event`, CONSTRAINT `FK_INDEX_PROCESS_EVENT_EVENT_ID_INDEX_EVENT_EVENT_ID` FOREIGN KEY (`event_id`) REFERENCES `testshop`.`index_event` (`event_id`)
Thank you !!!!