I am trying to mysqldump my database with a data stump on the file. I cant do it on a cmd because when I add %data% something weird happens. it adds a "1" caracter in the middle of the sentence like: if i do
mysqldump args > file.sql (works fine)
mysqldump args > file_%data%.sql (i get error)
with the data inside the cmd actually tries to run this:
mysqldump args 1 > file_%data%.sql (adds a "1" somehow - and the error is table "1" unknown - DOH)
so i tried this dump on powershell, and it works, i just need:
mysqldump args | Out-File file_$(get-date -f yyyy-MM-dd).sql -encoding UTF8
it runs but the encoding is wrong, it does not encode in utf8 but the data in the file name works fine
so my next try is to run a script in powershell that launches the cmd to make the .sql well exported, and exit the cmd, and back in the powershell rename the file to the final name (with date). But this i cant figure out how can i run powershell then launch a cmd script and come back to powershell.
Any tips how can i do this pls?
I searched a LOT there's a million posts of how to make the dump in cmd all together with a "for" and other non-sense nothing I neither understood or could make run.
In the powershell there's something wrong with the dump cuz the special characters inside the database get all messed up, both with utf8 and ascii encoding.
Sorry about my bad English. TY for tips.
(using win10 64 pt-pt)