{"id":5364,"date":"2020-07-29T23:38:42","date_gmt":"2020-07-29T15:38:42","guid":{"rendered":"http:\/\/39.97.231.10\/?p=5364"},"modified":"2020-07-29T23:38:42","modified_gmt":"2020-07-29T15:38:42","slug":"mysql-%e5%8f%82%e6%95%b0%e8%a7%a3%e6%9e%90-password_require_current","status":"publish","type":"post","link":"http:\/\/www.weijing.co\/?p=5364","title":{"rendered":"MySQL \u53c2\u6570\u89e3\u6790 password_require_current"},"content":{"rendered":"<div>\npassword_require_current \u662f MySQL 8.0.13 \u7248\u672c\u5f15\u5165\u7684\u65b0\u53c2\u6570\uff0c\u8be5\u53c2\u6570\u5b9a\u4e49\u4e86\u4e00\u4e2a\u5bc6\u7801\u4fee\u6539\u7684\u5168\u5c40\u7b56\u7565\uff0c\u5982\u679c\u8be5\u53c2\u6570\u8bbe\u7f6e\u4e3aON\uff0c\u5728\u4fee\u6539\u8d26\u53f7\u7684\u5bc6\u7801\u65f6\uff0c\u4f1a\u8981\u6c42\u6307\u5b9a\u8d26\u53f7\u5f53\u524d\u4f7f\u7528\u7684\u5bc6\u7801\u3002\u7b80\u5355\u6765\u8bf4\uff0c\u5c31\u662f\u8bbe\u7f6e\u65b0\u5bc6\u7801\u65f6\uff0c\u9700\u8981\u7ed9\u51fa\u65e7\u5bc6\u7801\u3002\n<\/div>\n<div>\n<div>\npassword_require_current\uff1a<\/p>\n<ul>\n<li>\u4f5c\u7528\u8303\u56f4\uff1aGlobal<\/li>\n<li>\u52a8\u6001\u4fee\u6539\uff1aYes<\/li>\n<li>\u53d6\u503c\u8303\u56f4\uff1aON\uff0cOFF<\/li>\n<li>\u9ed8\u8ba4\u503c\uff1aOFF<\/li>\n<\/ul>\n<p>\u6765\u770b\u4e0b\u9762\u7684\u793a\u4f8b\uff0cpassword_require_current=ON\u8bbe\u7f6e\u4e0b\uff0c\u4fee\u6539\u5bc6\u7801\u6ca1\u6709\u6307\u5b9a\u65e7\u5bc6\u7801\uff0c\u62a5\u9519\uff0c\u4f7f\u7528replace\u5b50\u53e5\u6307\u5b9a\u65e7\u5bc6\u7801\uff0c\u518d\u6b21\u6267\u884c\uff0c\u6210\u529f\u3002<\/p>\n<pre>mysql&gt; alter user app@\\'%\\' identified by \\'cC@12345678\\';\nERROR 3892 (HY000): Current password needs to be specified in the REPLACE clause in order to change it.\nmysql&gt; alter user app@\\'%\\' identified by \\'cC@12345678\\' replace \\'bB@12345678\\';\nQuery OK, 0 rows affected (0.01 sec)\n<\/pre>\n<p>\u9664\u4e86\u4f7f\u7528\u53c2\u6570password_require_current\u6765\u63a7\u5236\u5168\u5c40\u7684\u5bc6\u7801\u4fee\u6539\u7b56\u7565\u5916\uff0c\u8fd8\u53ef\u4ee5\u5728create user\u548calter user\u8bed\u53e5\u4e2d\uff0c\u4f7f\u7528password require current\u5b50\u53e5\u5355\u72ec\u63a7\u5236\u67d0\u4e2a\u7528\u6237\u7684\u5bc6\u7801\u4fee\u6539\u7b56\u7565\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<ul>\n<li>create user app1@\\&#8217;%\\&#8217; identified by \\&#8217;aA@12345678\\&#8217; password require current;<\/li>\n<li>create user app2@\\&#8217;%\\&#8217; identified by \\&#8217;aA@12345678\\&#8217; password require current optional;<\/li>\n<li>create user app3@\\&#8217;%\\&#8217; identified by \\&#8217;aA@12345678\\&#8217; password require current default;<\/li>\n<\/ul>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>password_require_current \u662f MySQL 8.0.13 \u7248\u672c\u5f15\u5165\u7684\u65b0\u53c2\u6570\uff0c\u8be5\u53c2\u6570\u5b9a\u4e49\u4e86 &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"http:\/\/www.weijing.co\/?p=5364\"> <span class=\"screen-reader-text\">MySQL \u53c2\u6570\u89e3\u6790 password_require_current<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[90,88],"tags":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"mailpoet_newsletter_max":false,"woocommerce_thumbnail":false,"woocommerce_single":false,"woocommerce_gallery_thumbnail":false,"shop_catalog":false,"shop_single":false,"shop_thumbnail":false},"uagb_author_info":{"display_name":"weijing","author_link":"http:\/\/www.weijing.co\/?author=4"},"uagb_comment_info":0,"uagb_excerpt":"password_require_current \u662f MySQL 8.0.13 \u7248\u672c\u5f15\u5165\u7684\u65b0\u53c2\u6570\uff0c\u8be5\u53c2\u6570\u5b9a\u4e49\u4e86&hellip;","_links":{"self":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/5364"}],"collection":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5364"}],"version-history":[{"count":0,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/5364\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5364"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}