0

script.sh

#!/bin/sh
mysql -u root -pmysql --xml << eof
SELECT TABLE_NAME AS "Table Name", table_rows AS "Quant of Rows", ROUND((data_length + index_length)/1024/1024,2) AS "Total Size Mb"  FROM information_schema.TABLES WHERE information_schema.TABLES.table_schema='database_name';
eof

I am getting xml data with above script. How may I get this data in xml file ?

1

1 Answer 1

0
#!/bin/sh
mysql -u root -pmysql --xml > /home/test/Desktop/temp.xml << eof
SELECT TABLE_NAME AS "Table Name", table_rows AS "Quant of Rows", ROUND((data_length + index_length)/1024/1024,2) AS "Total Size Mb"  FROM information_schema.TABLES WHERE information_schema.TABLES.table_schema='database_name';
eof

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .