{"id":4854,"date":"2020-11-30T15:11:39","date_gmt":"2020-11-30T07:11:39","guid":{"rendered":"https:\/\/damogame.cn\/wordpress\/?p=4854"},"modified":"2020-11-30T15:12:00","modified_gmt":"2020-11-30T07:12:00","slug":"mariadb-%e5%88%9b%e5%bb%ba%e7%94%a8%e6%88%b7%e5%8f%8a%e6%8e%88%e6%9d%83","status":"publish","type":"post","link":"https:\/\/i007.cc\/wordpress\/archives\/4854","title":{"rendered":"mariadb \u521b\u5efa\u7528\u6237\u53ca\u6388\u6743"},"content":{"rendered":"<div class=\"rEsl9f\">\n<div class=\"_2mYfmT\">\n<div class=\"s-dsoj\"><a href=\"https:\/\/www.jianshu.com\/p\/4466e0cd0bd1\">\u539f\u6587\u5730\u5740<\/a><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<article class=\"_2rhmJa\">\n<h3>centos \u5b89\u88c5mariadb<\/h3>\n<p>yum install mariadb mariadb-server<br \/>\nsystemctl start mariadb ==&gt; \u542f\u52a8mariadb<br \/>\nsystemctl enable mariadb ==&gt; \u5f00\u673a\u81ea\u542f\u52a8<\/p>\n<h3>\u521b\u5efa\u7528\u6237<\/h3>\n<p>\u547d\u4ee4:**CREATE USER &#8216;username&#8217;@&#8217;host&#8217; IDENTIFIED BY &#8216;password&#8217;; **<br \/>\n\u8bf4\u660e:<br \/>\nusername &#8211; \u4f60\u5c06\u521b\u5efa\u7684\u7528\u6237\u540d,<br \/>\nhost &#8211; \u6307\u5b9a\u8be5\u7528\u6237\u5728\u54ea\u4e2a\u4e3b\u673a\u4e0a\u53ef\u4ee5\u767b\u9646,\u5982\u679c\u662f\u672c\u5730\u7528\u6237\u53ef\u7528localhost, \u5982\u679c\u60f3\u8ba9\u8be5\u7528\u6237\u53ef\u4ee5\u4ece\u4efb\u610f\u8fdc\u7a0b\u4e3b\u673a\u767b\u9646,\u53ef\u4ee5\u4f7f\u7528\u901a\u914d\u7b26%.<br \/>\npassword &#8211; \u8be5\u7528\u6237\u7684\u767b\u9646\u5bc6\u7801,\u5bc6\u7801\u53ef\u4ee5\u4e3a\u7a7a,\u5982\u679c\u4e3a\u7a7a\u5219\u8be5\u7528\u6237\u53ef\u4ee5\u4e0d\u9700\u8981\u5bc6\u7801\u767b\u9646\u670d\u52a1\u5668.<br \/>\n\u4f8b\u5b50:<\/p>\n<p>CREATE USER &#8216;m23100&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;123456&#8217;;<br \/>\nCREATE USER &#8216;m23100&#8217;@&#8217;192.168.1.101&#8217; IDENDIFIED BY &#8216;123456&#8217;;<br \/>\nCREATE USER &#8216;m23100&#8217;@&#8217;%&#8217; IDENTIFIED BY &#8216;123456&#8217;;<br \/>\nCREATE USER &#8216;m23100&#8217;@&#8217;%&#8217; IDENTIFIED BY &#8221;;<br \/>\nCREATE USER &#8216;m23100&#8217;@&#8217;%&#8217;;<\/p>\n<h3>\u6388\u6743:<\/h3>\n<p>\u547d\u4ee4:**GRANT privileges ON databasename.tablename TO &#8216;username&#8217;@&#8217;host&#8217; **<br \/>\n\u8bf4\u660e: privileges &#8211; \u7528\u6237\u7684\u64cd\u4f5c\u6743\u9650,\u5982SELECT , INSERT , UPDATE \u7b49.\u5982\u679c\u8981\u6388\u4e88\u6240\u7684\u6743\u9650\u5219\u4f7f\u7528ALL.;<br \/>\ndatabasename &#8211; \u6570\u636e\u5e93\u540d,<br \/>\ntablename-\u8868\u540d,<br \/>\n\u5982\u679c\u8981\u6388\u4e88\u8be5\u7528\u6237\u5bf9\u6240\u6709\u6570\u636e\u5e93\u548c\u8868\u7684\u76f8\u5e94\u64cd\u4f5c\u6743\u9650\u5219\u53ef\u7528 * \u8868\u793a, \u5982 *.*<br \/>\n\u4f8b\u5b50:<\/p>\n<p>GRANT SELECT, INSERT ON test.user TO &#8216;m23100&#8217;@&#8217;%&#8217;;<br \/>\nGRANT ALL ON *.* TO &#8216;m23100&#8217;@&#8217;%&#8217;;<br \/>\nflush privileges; \u5237\u65b0\u6743\u9650\uff1a<\/p>\n<p>\u6ce8\u610f:\u7528\u4ee5\u4e0a\u547d\u4ee4\u6388\u6743\u7684\u7528\u6237\u4e0d\u80fd\u7ed9\u5176\u5b83\u7528\u6237\u6388\u6743,\u5982\u679c\u60f3\u8ba9\u8be5\u7528\u6237\u53ef\u4ee5\u6388\u6743,\u7528\u4ee5\u4e0b\u547d\u4ee4:<\/p>\n<p>GRANT privileges ON databasename.tablename TO &#8216;username&#8217;@&#8217;host&#8217; WITH GRANT OPTION;<\/p>\n<p>mariadb\u6570\u636e\u5e93\u7684\u76f8\u5173\u547d\u4ee4\u662f\uff1a<\/p>\n<p>systemctl start mariadb #\u542f\u52a8MariaDB<br \/>\nsystemctl stop mariadb #\u505c\u6b62MariaDB<br \/>\nsystemctl restart mariadb #\u91cd\u542fMariaDB<br \/>\nsystemctl enable mariadb #\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8<\/p>\n<\/article>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\u5730\u5740 centos \u5b89\u88c5mariad<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[],"tags":[117],"class_list":["post-4854","post","type-post","status-publish","format-standard","hentry","tag-01-linux"],"_links":{"self":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/4854","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/comments?post=4854"}],"version-history":[{"count":0,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/4854\/revisions"}],"wp:attachment":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/media?parent=4854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/categories?post=4854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/tags?post=4854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}