0

i have a database test in that db every day table created with date like DATAM_D_YYYY

i want to take every day latest table backup i use below command to take back-up mysql version is 5.7.24

mysql -u root -p --xml -e "select * from  test%m_%d_%y" > path.xml

but getting rror

Please let me know

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
joe
  • 73
  • 1
  • 8
  • Like [this recent question](https://stackoverflow.com/questions/56069098/how-do-i-delete-all-rows-from-all-tables-in-a-database-from-mysql), "This is why you shouldn't use dynamic table names in the first place." – danblack May 10 '19 at 03:28
  • btw 5.7.1 is a beta release version of MySQL. It should be run in production. – danblack May 10 '19 at 03:42
  • for 5.7.24 version – joe May 10 '19 at 03:44
  • I can tell you a way around, You can create a separate table, where you can store this table name and current timestamp, when you'll create a new table add an entry to this table. And when you want to take a backup, select a record from the new table based on time desc. and take a backup. – Kaushik May 10 '19 at 06:00

0 Answers0