Académique Documents
Professionnel Documents
Culture Documents
To find out the size of a single MySQL database called rcubemail (which displays
the size of all tables in it) use the following mysql query.
SELECT
TABLE_NAME AS `Table`,
ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)`
FROM
information_schema.TABLES
WHERE
TABLE_SCHEMA = "amey"
AND
TABLE_NAME = "actor"
ORDER BY
(DATA_LENGTH + INDEX_LENGTH)
DESC;
SELECT
TABLE_NAME AS `Table`,
ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)`
FROM
information_schema.TABLES
WHERE
TABLE_SCHEMA = "amey"
ORDER BY
(DATA_LENGTH + INDEX_LENGTH)
DESC;
to find all table size of the database
SELECT
TABLE_SCHEMA AS `Database`,
TABLE_NAME AS `Table`,
ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)`
FROM
information_schema.TABLES
ORDER BY
(DATA_LENGTH + INDEX_LENGTH)
DESC;
DELETING USERS
To view a list of all users, type the following command from the mysql> prompt: