{"id":931,"date":"2019-11-28T10:53:20","date_gmt":"2019-11-28T07:53:20","guid":{"rendered":"https:\/\/blog.airmeno.ru\/?p=931"},"modified":"2019-11-28T11:21:04","modified_gmt":"2019-11-28T08:21:04","slug":"razmer-bazy-dannyh-v-mysql-mariadb","status":"publish","type":"post","link":"https:\/\/blog.airmeno.ru\/?p=931","title":{"rendered":"\u0420\u0430\u0437\u043c\u0435\u0440 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 MySQL (MariaDB)"},"content":{"rendered":"\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0442\u043e\u0439 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u0435\u0431 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 (PHP) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 MySQL (MariaDB). \u041d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 MySQL (MariaDB).<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u041f\u043e\u0448\u0435\u043b \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043f\u0443\u0442\u0435\u043c. \u0420\u0430\u0437\u043c\u0435\u0440 \u043f\u0430\u043f\u043a\u0438 \u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0431\u0430\u0437\u044b MySQL:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>du -h \/var\/lib\/mysql<\/code><\/pre>\n\n\n\n<p>\u041c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0447\u0442\u043e \u0446\u0438\u0444\u0440\u044b \u0437\u0430\u0432\u044b\u0448\u0435\u043d\u044b \u0438 \u0442\u0430\u043a \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u0432\u0435\u0440\u043d\u043e, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0441\u0430\u043c\u043e\u0439 \u0421\u0423\u0411\u0414. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a mysql:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<p>\u0417\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u041c\u0431, MySQL \u043e\u0442\u0434\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442  \u0432 \u0431\u0430\u0439\u0442\u0430\u0445):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT table_schema AS \"\u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445\", ROUND(SUM(data_length + index_length) \/ 1024 \/ 1024, 2) AS \"\u0420\u0430\u0437\u043c\u0435\u0440 \u0432 \u041c\u0431\" FROM information_schema.TABLES GROUP BY table_schema;<\/code><\/pre>\n\n\n\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0413\u0431 &#8212; \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT table_schema AS \"\u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445\", ROUND(SUM(data_length + index_length) \/ 1024 \/ 1024 \/ 1024, 2) AS \"\u0420\u0430\u0437\u043c\u0435\u0440 \u0432 \u0413\u0431\" FROM information_schema.TABLES GROUP BY table_schema;<\/code><\/pre>\n\n\n\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u0442\u0430\u0431\u043b\u0438\u0446 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0430\u043c\u043e\u0439 \u0431\u0430\u0437\u044b:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT table_name AS \"\u0422\u0430\u0431\u043b\u0438\u0446\u044b\", ROUND(((data_length + index_length) \/ 1024 \/ 1024), 2) AS \"\u0420\u0430\u0437\u043c\u0435\u0440 \u0432 \u041c\u0431\" FROM information_schema.TABLES WHERE table_schema = \"\u0442\u0443\u0442 \u0438\u043c\u044f \u043d\u0443\u0436\u043d\u043e\u0439 \u0431\u0430\u0437\u044b\" ORDER BY (data_length + index_length) DESC;<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0442\u043e\u0439 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u0435\u0431 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 (PHP) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 MySQL (MariaDB). \u041d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[65],"tags":[102,49],"_links":{"self":[{"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/posts\/931"}],"collection":[{"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=931"}],"version-history":[{"count":4,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/posts\/931\/revisions"}],"predecessor-version":[{"id":937,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/posts\/931\/revisions\/937"}],"wp:attachment":[{"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}