Wednesday, November 05, 2014

mysqldump with where caluse

mysqldump  with where caluse,  selectively exporting data that matches the conditions.

One of this features of the MySQL mysqldump utility is to adapt the individual queries in order to limit the rows selected in the backup. This is achieved with the “-w” or “–where” which appends the same WHERE clause on each of the tables.

e.g.
mysqldump -uroot db_customer customer_table -w "date(cust_insert_time) < '2013-06-01 00:00:00' " --opt > db_db_customer customer_table_beforejun1.sql
or
mysqldump -uroot --no-create-info db_customer customer_table -w "date(cust_insert_time) < '2013-06-01 00:00:00' " --opt > db_db_customer customer_table_beforejun1.sql

 

No comments:

Basics of Kubernetes

 Kubernetes, often abbreviated as K8s , is an open-source platform designed to automate the deployment, scaling, and management of container...