Mysql stores all databases in it main database path and if innodb is used, even all databases are in the same file. So the only way to get the size is to query mysql for the table sizes and then build some kind of quota function around that.