Mysql Snippets

Getting Database Size

echo "SELECT TABLE STATUS" | mysql-dbrc //database// | awk '{sum=sum+$7+$9;} END {print sum/1024/1024 "M"}'

Add an Index

ALTER TABLE table_name ADD INDEX (fields to index...)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.