1

I want to take the dump only of the latest rows. But When i pass the --where option its not dumping the rows. but when i execute select query with the same where clause it returns the rows. here is my select query:

SELECT  * FROM abc.`xyz` WHERE UPDATED_AT >="2015-11-11 10:03:37";

here is my mysqldump command:

 mysqldump --no-create-info --replace -h source_server --user=backup1 --password='passcode' abc xyz --where='UPDATED_AT >="2015-11-11 10:03:37"'  > "backup.sql"

What is the problem in the above mysqldump command why its not dumping the records?

dump file portion is as under:

 --
 -- Dumping data for table `xyz`
 --
 -- WHERE:  UPDATED_AT >='2015-11-11 10:03:37'

 LOCK TABLES `xyz` WRITE;
 /*!40000 ALTER TABLE `xyz` DISABLE KEYS */;
 /*!40000 ALTER TABLE `xyz` ENABLE KEYS */;
 UNLOCK TABLES;
Baran
  • 1,114
  • 1
  • 10
  • 25

2 Answers2

0

In where clause the UPDATED_AT field type was timestamp I changed the field type to DATETIME. It worked as expected.

For the latest version above field type changing works but for the mysql 5.0.5 FROM_UNIXTIME works.

Baran
  • 1,114
  • 1
  • 10
  • 25
0

Try the following command:

mysqldump --tz-utc=0 --no-create-info --replace -h source_server --user=backup1 --password='passcode' abc xyz --where='UPDATED_AT >="2015-11-11 10:03:37"'  > "backup.sql"
Omar Einea
  • 2,478
  • 7
  • 23
  • 35