If you have searched on the internets how to get the full MySQL database size, you have probably read something like this:
SELECT CONCAT(sum(ROUND((DATA_LENGTH + INDEX_LENGTH - DATA_FREE) / 1024 / 1024,2))," MB") AS Size FROM INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA = 'database_name';
For certain DB, I was getting:
ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in '((`information_schema`.`TABLES`.`DATA_LENGTH` + `information_schema`.`TABLES`.`INDEX_LENGTH`) - `information_schema`.`TABLES`.`DATA_FREE`)'
So, here is your fix:
SELECT CONCAT(sum(ROUND((CAST(DATA_LENGTH + INDEX_LENGTH AS SIGNED) - CAST(DATA_FREE AS SIGNED)) / 1024 / 1024,2))," MB") AS Size FROM INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA = 'database_name';