MySQL database size?
Posted: Tue Dec 28, 2004 7:06 pm
Does anyone know how I can display how much space has been used in the mysql database?. I was thinking of using 'show table status' and then grabbing the Data_length entry but I am not sure how I should do it. When I try it only seems to be showing the size of the first table?.
Code: Select all
$sql = "SHOW TABLE STATUS FROM " . DATABASE_DBNAME;
$res = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_assoc($res);
define('SYS_MYSQL_DBSIZE', $row['Data_length']);