{"id":1080,"date":"2019-05-06T22:19:57","date_gmt":"2019-05-06T19:19:57","guid":{"rendered":"https:\/\/artem.services\/?p=1080"},"modified":"2019-08-05T11:45:47","modified_gmt":"2019-08-05T08:45:47","slug":"mysql-%d0%be%d1%81%d0%bd%d0%be%d0%b2%d0%bd%d1%8b%d0%b5-%d0%ba%d0%be%d0%bc%d0%b0%d0%bd%d0%b4%d1%8b","status":"publish","type":"post","link":"https:\/\/artem.services\/?p=1080","title":{"rendered":"MySQL &#8212; \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b"},"content":{"rendered":"<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u043c\u0443 \u043f\u043e\u043b\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0431\u0430\u0437\u0435:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nCREATE DATABASE database_name CHARACTER SET utf8 COLLATE utf8_general_ci;\r\nCREATE USER 'user_name'@'%' IDENTIFIED BY 'PASSWORD';\r\nGRANT ALL PRIVILEGES ON database_name.* TO 'user_name'@'%';\r\nFLUSH PRIVILEGES;\r\n<\/pre>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u043d\u0443\u0436\u043d\u043e:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n'user_name'@'%'\r\n<\/pre>\n<p>\u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n'user_name'@'localhost'\r\n<\/pre>\n<p>\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u0430\u0432\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0431\u0430\u0437\u0443:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nREVOKE ALL ON database_name.* FROM 'user_name'@'localhost';\r\n<\/pre>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c \u0434\u0430\u043c\u043f \u0431\u0430\u0437\u044b:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmysqldump -u user_name -p database_name &gt; database_name.sql\r\n<\/pre>\n<p>\u0417\u0430\u043b\u0438\u0432\u0430\u0435\u043c \u0434\u0430\u043c\u043f:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmysql -u user_name -p database_name &lt; database_name.sql\r\n<\/pre>\n<p>\u0421\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nSELECT User,Host FROM mysql.user;\r\n<\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c Read-Only \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u0431\u0430\u0437\u044b:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nCREATE USER 'readonly_user_name'@'%' IDENTIFIED BY 'password';\r\nGRANT SELECT ON database_name.* TO 'readonly_user_name'@'%';\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u043c\u0443 \u043f\u043e\u043b\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0431\u0430\u0437\u0435: \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u043d\u0443\u0436\u043d\u043e: \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430: \u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u0430\u0432\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0431\u0430\u0437\u0443: \u0414\u0435\u043b\u0430\u0435\u043c \u0434\u0430\u043c\u043f \u0431\u0430\u0437\u044b: \u0417\u0430\u043b\u0438\u0432\u0430\u0435\u043c \u0434\u0430\u043c\u043f: \u0421\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439: \u0421\u043e\u0437\u0434\u0430\u0435\u043c Read-Only \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u0431\u0430\u0437\u044b:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[45],"tags":[145],"_links":{"self":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1080"}],"collection":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1080"}],"version-history":[{"count":6,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1080\/revisions"}],"predecessor-version":[{"id":1363,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1080\/revisions\/1363"}],"wp:attachment":[{"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1080"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}