Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bilardi/aef8b60fc3a6fcc18417504a87d5eb94 to your computer and use it in GitHub Desktop.
Save bilardi/aef8b60fc3a6fcc18417504a87d5eb94 to your computer and use it in GitHub Desktop.
When the MySQL monitoring is not enabled
# do you have cpu utilization 100% and don't you have any logging and don't you know that MySQL instance?
For understanding who is connected, what queries they have executed and how long queries are running
* check the client connections
* and check the queries are running for a long time
The system works fine for months and only now there is a problem?
* check the last changes with the developers
* and check the size of datadir or run these queries
```
-- overview databases
SELECT table_schema AS "Database",
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)"
FROM information_schema.TABLES
GROUP BY table_schema;
-- overview tables
SELECT table_schema AS "Database", table_name AS "Table",
ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)"
FROM information_schema.TABLES
ORDER BY (data_length + index_length) DESC;
```
Haven't you found the problem yet?
* contact your technical administrator
* and be patience because what your technical administrator is following now it is also a priority
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment