{"id":2229,"date":"2017-04-28T11:04:16","date_gmt":"2017-04-28T03:04:16","guid":{"rendered":"http:\/\/192.168.50.160\/wordpress\/?p=2229"},"modified":"2017-04-28T11:04:16","modified_gmt":"2017-04-28T03:04:16","slug":"mysql-5-7-%e5%af%86%e7%a2%bc%e9%87%8d%e8%a8%ad","status":"publish","type":"post","link":"https:\/\/history.dowdot.idv.tw\/?p=2229","title":{"rendered":"MySQL 5.7 \u5bc6\u78bc\u91cd\u8a2d"},"content":{"rendered":"<p>\u6700\u8fd1\u5b89\u88dd\u4e86 MySQL 5.7\u7684\u7248\u672c\u5f8c\u767c\u73fe<br \/>\n\u4f7f\u7528\u9810\u8a2d\u7684Root\u5bc6\u78bc(\u7a7a\u767d)\u5c45\u7136\u7121\u6cd5\u9032\u5165<br \/>\n\u4e0a\u7db2\u67e5\u4e86\u4e00\u4e0b, \u5c45\u7136log\u6a94\u88e1\u6709\u5f88\u7279\u5225\u7684\u5bc6\u78bc\u5b57\u4e32<br \/>\ngrep 'temporary password' \/var\/log\/mysqld.log<\/p>\n<p>\u9084\u597d\u7528\u4ee5\u4e0b\u7684\u65b9\u5f0f,\u5c07\u521d\u59cb\u5bc6\u78bc\u7d66\u6539\u6389\u4e86!!<br \/>\n<code>1. Stop mysql:<br \/>\nsystemctl stop mysqld<\/p>\n<ol>\n<li>Set the mySQL environment option<br \/>\nsystemctl set-environment MYSQLD_OPTS=\"--skip-grant-tables\"<\/p>\n<\/li>\n<li>\n<p>Start mysql usig the options you just set<br \/>\nsystemctl start mysqld<\/p>\n<\/li>\n<li>\n<p>Login as root<br \/>\nmysql -u root<\/p>\n<\/li>\n<li>\n<p>Update the root user password with these mysql commands<br \/>\nmysql> UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPassword')<br \/>\n-> WHERE User = 'root' AND Host = 'localhost';<br \/>\nmysql> FLUSH PRIVILEGES;<br \/>\nmysql> quit<\/p>\n<\/li>\n<li>\n<p>Stop mysql<br \/>\nsystemctl stop mysqld<\/p>\n<\/li>\n<li>\n<p>Unset the mySQL envitroment option so it starts normally next time<br \/>\nsystemctl unset-environment MYSQLD_OPTS<\/p>\n<\/li>\n<li>\n<p>Start mysql normally:<br \/>\nsystemctl start mysqld<\/p>\n<\/li>\n<\/ol>\n<p>Try to login using your new password:<br \/>\n7. mysql -u root -p<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5b89\u88dd\u4e86 MySQL 5.7\u7684\u7248\u672c\u5f8c\u767c\u73fe \u4f7f\u7528\u9810\u8a2d\u7684Root\u5bc6\u78bc(\u7a7a\u767d)\u5c45\u7136\u7121\u6cd5\u9032\u5165 \u4e0a\u7db2\u67e5\u4e86\u4e00\u4e0b, \u5c45\u7136log\u6a94\u88e1\u6709\u5f88\u7279\u5225\u7684\u5bc6\u78bc\u5b57\u4e32 grep &#8216;temporary password&#8217; \/var\/log\/mysqld.log \u9084\u597d\u7528\u4ee5\u4e0b\u7684\u65b9\u5f0f,\u5c07\u521d\u59cb\u5bc6\u78bc\u7d66\u6539\u6389\u4e86!! 1. Stop mysql:&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"ngg_post_thumbnail":0,"spay_email":""},"categories":[1],"tags":[],"jetpack_featured_media_url":"","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5NCTI-zX","_links":{"self":[{"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/2229"}],"collection":[{"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2229"}],"version-history":[{"count":1,"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/2229\/revisions"}],"predecessor-version":[{"id":2230,"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/2229\/revisions\/2230"}],"wp:attachment":[{"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}