Adarq.org

The Lab => Notes => Topic started by: adarqui on June 26, 2014, 09:47:04 pm

Title: MySQL
Post by: adarqui on June 26, 2014, 09:47:04 pm
Random mysql notes.

List DB by size:
Code: [Select]
SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB"
FROM information_schema.TABLES GROUP BY table_schema ;
(reference: http://forums.mysql.com/read.php?108,201578,201578)


Optimizing tables via mysqlcheck:
-o will optimize the table. If the table doesn't support optimization , it will be recreated.
Code: [Select]
mysqlcheck -o database -u user -p