How do I call the following in a .sql file?
mysql -u username -h serverip db -e "select a, b, c, d from mytable" > '/home/dump/result.txt';
I will then have to convert the tab separated file to csv for which I want to use sed.
- Is there a way to do it all in one
line? (append sed command to convert
the .txt file to csv) - How to use an
os.system call in .sql file? Will it
work?
Try this:
See docs for
--batchand--skip-column-namesfor more info.