{"id":630,"date":"2023-02-26T11:16:12","date_gmt":"2023-02-26T03:16:12","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=630"},"modified":"2023-04-29T20:15:30","modified_gmt":"2023-04-29T12:15:30","slug":"mysql-creates-users-and-databases","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/26\/mysql-creates-users-and-databases\/","title":{"rendered":"MySQL\u521b\u5efa\u7528\u6237\u53ca\u540d\u4e0b\u6570\u636e\u5e93"},"content":{"rendered":"<h2>\u521b\u5efa\u7528\u6237\u53ca\u540c\u540d\u6570\u636e\u5e93<\/h2>\n<pre><code class=\"language-sql\">CREATE USER &#039;HttpApi&#039;@&#039;localhost&#039; IDENTIFIED WITH mysql_native_password;\nGRANT USAGE ON *.* TO &#039;HttpApi&#039;@&#039;localhost&#039; REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;\nSET PASSWORD FOR &#039;HttpApi&#039;@&#039;localhost&#039; = PASSWORD(&#039;******&#039;);\nCREATE DATABASE IF NOT EXISTS `HttpApi`;\nGRANT ALL PRIVILEGES ON `HttpApi`.* TO &#039;HttpApi&#039;@&#039;localhost&#039;;\nGRANT ALL PRIVILEGES ON `HttpApi\\_%`.* TO &#039;HttpApi&#039;@&#039;localhost&#039;;<\/code><\/pre>\n<p><!-- more --><\/p>\n<h2>\u521b\u5efa\u7528\u6237\u53ca\u5206\u914d\u591a\u4e2a\u6570\u636e\u5e93<\/h2>\n<pre><code class=\"language-sql\">CREATE USER &#039;apollo&#039;@&#039;%&#039; IDENTIFIED WITH mysql_native_password;\nGRANT USAGE ON *.* TO &#039;apollo&#039;@&#039;%&#039; REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;\nSET PASSWORD FOR &#039;apollo&#039;@&#039;%&#039; = PASSWORD(&#039;******&#039;);\nCREATE DATABASE IF NOT EXISTS `ApolloPortalDB`;\nGRANT ALL PRIVILEGES ON `ApolloPortalDB`.* TO &#039;apollo&#039;@&#039;%&#039;;\nGRANT ALL PRIVILEGES ON `ApolloPortalDB\\_%`.* TO &#039;apollo&#039;@&#039;%&#039;;\nCREATE DATABASE IF NOT EXISTS `ApolloConfigDB`;\nGRANT ALL PRIVILEGES ON `ApolloConfigDB`.* TO &#039;apollo&#039;@&#039;%&#039;;\nGRANT ALL PRIVILEGES ON `ApolloConfigDB\\_%`.* TO &#039;apollo&#039;@&#039;%&#039;;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u521b\u5efa\u7528\u6237\u53ca\u540c\u540d\u6570\u636e\u5e93 CREATE USER &#039;HttpApi&#039;@&#039;localh [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-630","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/630","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=630"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/630\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}