Skip to content

Instantly share code, notes, and snippets.

@sudhanshu-bajaj
Created April 3, 2021 07:01
Show Gist options
  • Save sudhanshu-bajaj/a12c601f9f4cb280c153fa38f14d80c7 to your computer and use it in GitHub Desktop.
Save sudhanshu-bajaj/a12c601f9f4cb280c153fa38f14d80c7 to your computer and use it in GitHub Desktop.
Magento 2: How to delete all customers data?
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `amazon_customer`;
TRUNCATE TABLE `customer_address_entity`;
TRUNCATE TABLE `customer_address_entity_datetime`;
TRUNCATE TABLE `customer_address_entity_decimal`;
TRUNCATE TABLE `customer_address_entity_int`;
TRUNCATE TABLE `customer_address_entity_text`;
TRUNCATE TABLE `customer_address_entity_varchar`;
TRUNCATE TABLE `customer_entity`;
TRUNCATE TABLE `customer_entity_datetime`;
TRUNCATE TABLE `customer_entity_decimal`;
TRUNCATE TABLE `customer_entity_int`;
TRUNCATE TABLE `customer_entity_text`;
TRUNCATE TABLE `customer_entity_varchar`;
TRUNCATE TABLE `customer_grid_flat`;
TRUNCATE TABLE `customer_log`;
TRUNCATE TABLE `customer_visitor`;
TRUNCATE TABLE `persistent_session`;
TRUNCATE TABLE `login_as_customer`;
TRUNCATE TABLE `magento_login_as_customer_log`;
TRUNCATE TABLE `wishlist`;
TRUNCATE TABLE `wishlist_item`;
TRUNCATE TABLE `wishlist_item_option`;
TRUNCATE TABLE `salesrule_customer`;
SET FOREIGN_KEY_CHECKS = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment