Hi
I have a linux server with mysql installed.There is some data in mysql tables.
Also.I have a .csv file (not from the aforementioned database)
I need to compare the data in the database nad the .csv and print out the difference.
I tried writing a shell script for that but I was unsuccessful.
I need to ask if there's any way I can export the data from mysql tables to .csv file format and use the diff command to see the comparison of the generated file and the file I had initially.
~thanks
---------- Post updated at 05:59 PM ---------- Previous update was at 05:56 PM ----------
I found one ..
mysql -uexampleuser -pletmein exampledb -B -e "select * from \`person\`;" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > filename.csv
but before select statement could begin,I need to write another statement
use xyz;
how do I induce this (use xyz;) in the shell code .. piping isnt helping
~thanks