save mysql sqery output into txt file
You just need to modify the query and login credential then run the below command of database server . mysql -e “select * FROM tabledata” -u satya -pPrakash databasename > /home/ob_cdr.txt However i have written a shell script to do this job. #!/bin/bash USER=”root” PASSWORD=”rootpassword” #OUTPUT=”/home/ftpbackup/” OUTPUT=”/root/” rm “$OUTPUTDIR/*txt” > /dev/null 2>&1 databases=`mysql –user=$USER –password=$PASSWORD … Read more