I want to execute mysql command using shell scripting in centos i am writing command over can anyone please tell me how to write this script and i am taking output in file so everytime when i execute script it create new file .
SELECT TABLENAME, tablerow, round(data_length/1024/1024 ,2 ) as dl , round(index_length/1024/1024 ,2 ) as il , round(data_length/1024/1024 ,2 ) as dl , round((data_length + index_length)/1024/1024 ,2) "size in mb" from Information schema , TABLES WHERE TABLE_SCHEMA=" Db_name" order by data_length desc limit 10 in to out file ' ' FIELDS TERMINATED BY ' | ' ENCLOSED BY " " TERMINATED BY '\R\N '