{"id":88,"date":"2017-09-06T22:56:45","date_gmt":"2017-09-06T16:56:45","guid":{"rendered":"https:\/\/qtvz.com\/?p=88"},"modified":"2017-09-06T22:56:45","modified_gmt":"2017-09-06T16:56:45","slug":"%e8%ae%be%e7%bd%aemysql5-7%e8%bf%9c%e7%a8%8b%e8%bf%9e%e6%8e%a5","status":"publish","type":"post","link":"https:\/\/qtvz.com\/88.html","title":{"rendered":"\u8bbe\u7f6emysql5.7\u8fdc\u7a0b\u8fde\u63a5"},"content":{"rendered":"<!--wp-compress-html--><!--wp-compress-html no compression--><p>\u5728ubuntu14.04\u4e0a\u5b89\u88c5\u597dmysql5.7\u4e4b\u540e\uff0c\u672c\u5730\u53ef\u4ee5\u8fde\u63a5mysql\u670d\u52a1\u5668\u3002<br \/>\n\u8fdc\u7a0b\u5c31\u4e0d\u884c\u3002<\/p>\n<p>\u6ce8\u91ca\u6389\u5728\/etc\/mysql\/mysql.conf.d\/mysqld.cnf\u91cc\u9762\u7684bind-address = 127.0.0.1<\/p>\n<pre class=\"prettyprint\" name=\"code\"><code class=\"hljs vala has-numbering\"><span class=\"hljs-preprocessor\"># By default we only accept connections from localhost<\/span>\r\n<span class=\"hljs-preprocessor\">#bind-address   = 127.0.0.1<\/span><\/code><\/pre>\n<p>\u5982\u679c\u8fd8\u6709\u95ee\u9898\uff0c\u5982Access denied for user \u2018root\u2019@\u2019ip\u5730\u5740\u2019 (using password: YES)<\/p>\n<pre class=\"prettyprint\" name=\"code\"><code class=\"hljs lasso has-numbering\">mysql <span class=\"hljs-attribute\">-uroot<\/span> <span class=\"hljs-attribute\">-p<\/span><\/code><\/pre>\n<p>\u8f93\u5165root\u7528\u6237\u5bc6\u7801\uff0c\u8fdb\u5165mysql\u670d\u52a1\u5668\u547d\u4ee4\u884c<\/p>\n<pre class=\"prettyprint\" name=\"code\"><code class=\"hljs sql has-numbering\">use mysql;\r\n<span class=\"hljs-operator\"><span class=\"hljs-keyword\">Grant<\/span> <span class=\"hljs-keyword\">all<\/span> <span class=\"hljs-keyword\">on<\/span> *.* <span class=\"hljs-keyword\">to<\/span> <span class=\"hljs-string\">'root'<\/span>@<span class=\"hljs-string\">'%'<\/span> identified <span class=\"hljs-keyword\">by<\/span> <span class=\"hljs-string\">'root\u7528\u6237\u7684\u5bc6\u7801'<\/span> <span class=\"hljs-keyword\">with<\/span> <span class=\"hljs-keyword\">grant<\/span> <span class=\"hljs-keyword\">option<\/span>;<\/span>\r\nflush privileges;<\/code><\/pre>\n<p>\u7136\u540e\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u54ea\u4e9b\u7528\u6237\u548chost\u53ef\u4ee5\u8bbf\u95ee\uff0c%\u4ee3\u8868\u4efb\u610fip\u5730\u5740<\/p>\n<pre class=\"prettyprint\" name=\"code\"><code class=\"hljs sql has-numbering\"><span class=\"hljs-operator\"><span class=\"hljs-keyword\">select<\/span> <span class=\"hljs-keyword\">user<\/span>,host <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-keyword\">user<\/span>;<\/span><\/code><\/pre>\n<!--wp-compress-html no compression--><!--wp-compress-html-->","protected":false},"excerpt":{"rendered":"\u5728ubuntu14.04\u4e0a\u5b89\u88c5\u597dmysql5.7\u4e4b\u540e\uff0c\u672c\u5730\u53ef\u4ee5\u8fde\u63a5mysql\u670d\u52a1\u5668\u3002 \u8fdc\u7a0b\u5c31\u4e0d\u884c\u3002 \u6ce8\u91ca\u6389\u5728\/etc\/mysql\/mysql.conf.d\/mysqld.cnf\u91cc\u9762\u7684bind-addr \u00b7\u00b7\u00b7","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[30],"tags":[],"views":9765,"_links":{"self":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts\/88"}],"collection":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/comments?post=88"}],"version-history":[{"count":1,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts\/88\/revisions"}],"predecessor-version":[{"id":89,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts\/88\/revisions\/89"}],"wp:attachment":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/media?parent=88"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/categories?post=88"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/tags?post=88"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}