good day . I need some help please about code on how can i create a batch file that export mysql database by table.
FOR %%D IN `mysql -uroot -e "SHOW TABLES from sample"` do echo %%D mysqldump -uroot sample %%D > %%D.sql
help. thank you.
good day . I need some help please about code on how can i create a batch file that export mysql database by table.
FOR %%D IN `mysql -uroot -e "SHOW TABLES from sample"` do echo %%D mysqldump -uroot sample %%D > %%D.sql
help. thank you.
Start with next command:
FOR /F "tokens=*" %%D IN ('mysql -uroot -e "SHOW TABLES from sample"') do @echo %%D
Then you could refine and modify output with some %%~D modifiers.
Next resource on for /F command.
" on the tokens section. @xXxrk04 - "tokens=*" means proces the entire line and ignore any delimiters. He could also have used "delims=" - it's just personal preference."tokens=* delims=" as well :))