Monday, June 3, 2019

MYSQL Useful commands:



1. TO Get the Database size in Mysql

SELECT table_schema AS 'Database Name', ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS 'Size in (MB)' FROM information_schema.TABLES GROUP BY table_schema;

2. Take Schema backup ( backup with no data )
mysqldump -u root -p --no-data dbname > schema.sql