Extract Mysql table output to a log file

I need to compare the 2 mysql database tables. there are around 50 tables in each DB.
my idea is
in DB1
extract result select * from table1; to alog file1
in DB2
extract result select * from table1; to alog file2

now compare log file 1 file 2

pls help me out ...
thanks in advance

diff file1 file2
comm -3 file1 file2

?

thanks for ur responce
i first need to extract the table1 output(mysql) to a log file
ex: mysql> select * from table; >> /tmp/logfile

Pls use the thanks button when a post helps

mysql> spool /tmp/logfile
mysql> select * from table;
mysql> spool off

??

by the way you might want to remove header before creating the spool ?

mysql> set head off

You also might want to sort your extraction so this would make further comparison easier
you could use the clause

 ... order by ... asc|desc

in your sql statement

hi
i think u can try this

sqlplus -s DATABASE << EOF > log_file_1
select * from table1
EOF

sqlplus -s DATABASE << EOF > log_file_2
select * from table2
EOF

diff log_file1 log_file2

Most people would not use a tool designed to work for an Oracle DB on MySQL.

For MySQL you should use MySQL tools.