{"id":617,"date":"2024-11-24T17:29:46","date_gmt":"2024-11-24T09:29:46","guid":{"rendered":"http:\/\/www.chan.ink\/?p=617"},"modified":"2024-11-24T17:29:49","modified_gmt":"2024-11-24T09:29:49","slug":"%e3%80%90mysql%e3%80%91%e6%8e%88%e6%9d%83","status":"publish","type":"post","link":"http:\/\/www.chan.ink\/index.php\/2024\/11\/24\/%e3%80%90mysql%e3%80%91%e6%8e%88%e6%9d%83\/","title":{"rendered":"\u3010MySQL\u3011\u6388\u6743"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">grant \u6743\u9650 on \u6570\u636e\u5e93.\u8868 to &#8216;\u7528\u6237&#8217;@&#8217;IP\u5730\u5740&#8217;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grant all privileges on *.* TO 'wupeiqi'@'localhost';         -- \u7528\u6237wupeiqi\u62e5\u6709\u6240\u6709\u6570\u636e\u5e93\u7684\u6240\u6709\u6743\u9650\ngrant all privileges on day26.* TO 'wupeiqi'@'localhost';     -- \u7528\u6237wupeiqi\u62e5\u6709\u6570\u636e\u5e93day26\u7684\u6240\u6709\u6743\u9650\ngrant all privileges on day26.info TO 'wupeiqi'@'localhost';  -- \u7528\u6237wupeiqi\u62e5\u6709\u6570\u636e\u5e93day26\u4e2dinfo\u8868\u7684\u6240\u6709\u6743\u9650\n\ngrant select on day26.info TO 'wupeiqi'@'localhost';          -- \u7528\u6237wupeiqi\u62e5\u6709\u6570\u636e\u5e93day26\u4e2dinfo\u8868\u7684\u67e5\u8be2\u6743\u9650\ngrant select,insert on day26.* TO 'wupeiqi'@'localhost';      -- \u7528\u6237wupeiqi\u62e5\u6709\u6570\u636e\u5e93day26\u6240\u6709\u8868\u7684\u67e5\u8be2\u548c\u63d2\u5165\u6743\u9650\n\ngrant all privileges on day26db.* to 'wupeiqi4'@'%';\n\n\n\u6ce8\u610f\uff1aflush privileges;   -- \u5c06\u6570\u636e\u8bfb\u53d6\u5230\u5185\u5b58\u4e2d\uff0c\u4ece\u800c\u7acb\u5373\u751f\u6548\u3002<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>all privileges  \u9664grant\u5916\u7684\u6240\u6709\u6743\u9650\nselect          \u4ec5\u67e5\u6743\u9650\nselect,insert   \u67e5\u548c\u63d2\u5165\u6743\u9650\n...\nusage                   \u65e0\u8bbf\u95ee\u6743\u9650\nalter                   \u4f7f\u7528alter table\nalter routine           \u4f7f\u7528alter procedure\u548cdrop procedure\ncreate                  \u4f7f\u7528create table\ncreate routine          \u4f7f\u7528create procedure\ncreate temporary tables \u4f7f\u7528create temporary tables\ncreate user             \u4f7f\u7528create user\u3001drop user\u3001rename user\u548crevoke  all privileges\ncreate view             \u4f7f\u7528create view\ndelete                  \u4f7f\u7528delete\ndrop                    \u4f7f\u7528drop table\nexecute                 \u4f7f\u7528call\u548c\u5b58\u50a8\u8fc7\u7a0b\nfile                    \u4f7f\u7528select into outfile \u548c load data infile\ngrant option            \u4f7f\u7528grant \u548c revoke\nindex                   \u4f7f\u7528index\ninsert                  \u4f7f\u7528insert\nlock tables             \u4f7f\u7528lock table\nprocess                 \u4f7f\u7528show full processlist\nselect                  \u4f7f\u7528select\nshow databases          \u4f7f\u7528show databases\nshow view               \u4f7f\u7528show view\nupdate                  \u4f7f\u7528update\nreload                  \u4f7f\u7528flush\nshutdown                \u4f7f\u7528mysqladmin shutdown(\u5173\u95edMySQL)\nsuper                   ??\u4f7f\u7528change master\u3001kill\u3001logs\u3001purge\u3001master\u548cset global\u3002\u8fd8\u5141\u8bb8mysqladmin????\u8c03\u8bd5\u767b\u9646\nreplication client      \u670d\u52a1\u5668\u4f4d\u7f6e\u7684\u8bbf\u95ee\nreplication slave       \u7531\u590d\u5236\u4ece\u5c5e\u4f7f\u7528<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\u67e5\u770b\u6388\u6743\uff1a\nshow grants for '\u7528\u6237'@'IP\u5730\u5740'\n\nshow grants for 'wupeiqi'@'localhost';\nshow grants for 'wupeiqi4'@'%';\n<app-translate-content class=\"eusoft-translate-container-span-en ng-star-inserted\" _nghost-ng-c341168634=\"\"><span _ngcontent-ng-c341168634=\"\" class=\"eusoft-eudic-chrome-extension-translate-content\"><\/span><\/app-translate-content><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\u53d6\u6d88\u6388\u6743\uff1a\nrevoke \u6743\u9650 on \u6570\u636e\u5e93.\u8868 from '\u7528\u6237'@'IP\u5730\u5740'\n\nrevoke ALL PRIVILEGES on day26.* from 'wupeiqi'@'localhost';\n\nrevoke ALL PRIVILEGES on day26db.* from 'wupeiqi4'@'%';\n\u6ce8\u610f\uff1aflush privileges;   -- \u5c06\u6570\u636e\u8bfb\u53d6\u5230\u5185\u5b58\u4e2d\uff0c\u4ece\u800c\u7acb\u5373\u751f\u6548\u3002<app-translate-content _nghost-ng-c341168634=\"\" class=\"eusoft-translate-container-span-en ng-star-inserted\"><span _ngcontent-ng-c341168634=\"\" class=\"eusoft-eudic-chrome-extension-translate-content\"><\/span><\/app-translate-content><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>grant \u6743\u9650 on \u6570\u636e\u5e93.\u8868 to &#8216;\u7528\u6237&#8217;@&#8217;IP\u5730\u5740&#038;#8217 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-617","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/posts\/617","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/comments?post=617"}],"version-history":[{"count":1,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/posts\/617\/revisions"}],"predecessor-version":[{"id":618,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/posts\/617\/revisions\/618"}],"wp:attachment":[{"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/media?parent=617"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/categories?post=617"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/tags?post=617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}