Search code examples
mysqldump

mysqldump command in linux till date(I mean i dont want to dump changes in the database that i made today)


Normally we Dump data in such manner:

What i require is i just want to dump data till yesterday !!!

mysqldump -u root -p gateway > dumpfilename.sql


Solution

  • You can pass -e parameter with query that should be executed:

    mysqldump -u root -p troy22022012 -e "SELECT * FROM gateway WHERE ..." > dumpfilename.sql