MySQL Forums
Forum List  »  Newbie

Access Denied to INFORMATION_SCHEMA
Posted by: Carlos Mennens
Date: September 24, 2021 08:35AM

I am trying to keep the size of my database < a specific size (quota).

I am running the following query:
mysql> SELECT table_schema "DB Name",
    ->         ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
    -> FROM information_schema.tables
    -> GROUP BY table_schema;
+--------------------+---------------+
| DB Name            | DB Size in MB |
+--------------------+---------------+
| information_schema |           0.2 |
| mysql              |          10.5 |
| performance_schema |           0.0 |
| sys                |           0.0 |
| zoo                |           0.0 |
+--------------------+---------------+
5 rows in set (0.11 sec)

I then have a script that loops once the size quota is no longer > than 'x'.

The problem is I have to run OPTIMIZE / ANALYZE commands but they give me a permissions issue:
mysql> OPTIMIZE TABLE information_schema.Log;
ERROR 1044 (42000): Access denied for user 'root'@'%' to database 'information_schema'
mysql> grant all on information_schema.* to 'root'@'%';
ERROR 1044 (42000): Access denied for user 'root'@'%' to database 'information_schema'

Options: ReplyQuote


Subject
Written By
Posted
Access Denied to INFORMATION_SCHEMA
September 24, 2021 08:35AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.