{"id":139,"date":"2026-05-25T13:42:46","date_gmt":"2026-05-25T05:42:46","guid":{"rendered":"https:\/\/blog.fennubird.cn\/?p=139"},"modified":"2026-05-25T13:42:46","modified_gmt":"2026-05-25T05:42:46","slug":"mysql-8-4-%e5%bf%98%e8%ae%b0root%e5%af%86%e7%a0%81%e6%80%8e%e4%b9%88%e5%8a%9e","status":"publish","type":"post","link":"https:\/\/fennubird.cn\/index.php\/2026\/05\/25\/mysql-8-4-%e5%bf%98%e8%ae%b0root%e5%af%86%e7%a0%81%e6%80%8e%e4%b9%88%e5%8a%9e\/","title":{"rendered":"MySQL 8.4 \u5fd8\u8bb0root\u5bc6\u7801\u600e\u4e48\u529e"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u4e00\u6b21\u771f\u5b9e\u7684\u6392\u9519\u8bb0\u5f55\uff1a\u4ece\u5404\u79cd\u62a5\u9519\u5230\u6700\u7ec8\u89e3\u51b3\uff0c\u6db5\u76d6 MySQL 8.0 \u4e0e\u65e7\u7248\u672c\u7684\u6838\u5fc3\u5dee\u5f02<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">\u524d\u8a00<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u4f60\u8fd8\u5728\u4f7f\u7528 <code>UPDATE user SET password=PASSWORD('123456')...<\/code> \u8fd9\u79cd\u8001\u6389\u7259\u7684\u547d\u4ee4\u6765\u4fee\u6539 MySQL 8.0 \u7684\u5bc6\u7801\uff0c\u90a3\u8fd9\u7bc7\u6587\u7ae0\u5c31\u662f\u4e3a\u4f60\u51c6\u5907\u7684\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u6587\u8bb0\u5f55\u4e86\u6211\u5728 MySQL 8.4.8 \u4e0a\u5fd8\u8bb0\u5bc6\u7801\u540e\u7684\u5b8c\u6574\u6392\u9519\u8fc7\u7a0b\uff0c\u9047\u5230\u7684\u6bcf\u4e00\u4e2a\u9519\u8bef\u90fd\u6709\u5bf9\u5e94\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u73af\u5883\u8bf4\u660e<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>MySQL \u7248\u672c<\/strong>\uff1a8.4.8 (Linux\/Ubuntu)<\/li>\n\n\n\n<li><strong>\u64cd\u4f5c\u7cfb\u7edf<\/strong>\uff1aUbuntu 24.04+<\/li>\n\n\n\n<li><strong>\u95ee\u9898<\/strong>\uff1aroot \u5bc6\u7801\u9057\u5fd8\uff0c\u4e14\u9519\u8bef\u5730\u914d\u7f6e\u4e86 <code>mysql_native_password<\/code> \u63d2\u4ef6<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u5e38\u89c1\u9519\u8bef\u901f\u67e5\u8868<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u9519\u8bef\u4fe1\u606f<\/th><th>\u539f\u56e0<\/th><th>\u89e3\u51b3\u65b9\u6848<\/th><\/tr><\/thead><tbody><tr><td><code>ERROR 1064...syntax...PASSWORD('123456')<\/code><\/td><td>MySQL 8 \u5df2\u79fb\u9664 <code>PASSWORD()<\/code> \u51fd\u6570<\/td><td>\u4f7f\u7528 <code>ALTER USER<\/code> \u8bed\u6cd5<\/td><\/tr><tr><td><code>ERROR 1396 (HY000): Operation ALTER USER failed<\/code><\/td><td>\u5728 <code>--skip-grant-tables<\/code> \u6a21\u5f0f\u4e0b\u672a\u5237\u65b0\u6743\u9650<\/td><td>\u5148\u6267\u884c <code>FLUSH PRIVILEGES;<\/code><\/td><\/tr><tr><td><code>ERROR 1524 (HY000): Plugin 'mysql_native_password' is not loaded<\/code><\/td><td>\u7528\u6237\u88ab\u9519\u8bef\u914d\u7f6e\u4e3a\u4f7f\u7528\u672a\u52a0\u8f7d\u7684\u8ba4\u8bc1\u63d2\u4ef6<\/td><td>\u4fee\u6539 plugin \u4e3a <code>caching_sha2_password<\/code><\/td><\/tr><tr><td><code>ERROR 1819 (HY000): Your password does not satisfy...<\/code><\/td><td>\u5bc6\u7801\u5f3a\u5ea6\u4e0d\u7b26\u5408 MySQL 8 \u7684\u7b56\u7565<\/td><td>\u4f7f\u7528\u5f3a\u5bc6\u7801\u6216\u4e34\u65f6\u8c03\u4f4e\u7b56\u7565<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b8c\u6574\u89e3\u51b3\u6b65\u9aa4<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e00\u6b65\uff1a\u505c\u6b62 MySQL \u670d\u52a1<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>sudo systemctl stop mysql<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F6F6F4\">sudo systemctl stop mysql<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e8c\u6b65\uff1a\u4ee5\u8df3\u8fc7\u6743\u9650\u8868\u6a21\u5f0f\u542f\u52a8<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>\u627e\u5230\u4f60\u7684mysqld\u914d\u7f6e\u6587\u4ef6 \u4e00\u822c\u5728\/etc\/mysql\/\u4e0b\u9762\nsudo vim \/etc\/mysql\/mysql.conf.d\/mysqld.cnf\n\n# mysqld.conf\n&#91;mysqld&#93;\nskip-grant-tables \n\n# \u542f\u52a8\u670d\u52a1\nsudo systemctl start mysql<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #62E884\">\u627e\u5230\u4f60\u7684mysqld\u914d\u7f6e\u6587\u4ef6<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">\u4e00\u822c\u5728\/etc\/mysql\/\u4e0b\u9762<\/span><\/span>\n<span class=\"line\"><span style=\"color: #62E884\">sudo<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">vim<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">\/etc\/mysql\/mysql.conf.d\/mysqld.cnf<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #7B7F8B\"># mysqld.conf<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">&#91;mysqld&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #62E884\">skip-grant-tables<\/span><span style=\"color: #F6F6F4\"> <\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #7B7F8B\"># \u542f\u52a8\u670d\u52a1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #62E884\">sudo<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">systemctl<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">start<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">mysql<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e09\u6b65\uff1a\u514d\u5bc6\u7801\u767b\u5f55<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly># \u8f93\u5165\u4efb\u610f\u5bc6\u7801\nmysql -uroot -p<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F6F6F4\"># \u8f93\u5165\u4efb\u610f\u5bc6\u7801<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">mysql <\/span><span style=\"color: #F286C4\">-<\/span><span style=\"color: #F6F6F4\">uroot <\/span><span style=\"color: #F286C4\">-<\/span><span style=\"color: #F6F6F4\">p<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u56db\u6b65\uff1a\u4fee\u590d\u7528\u6237\u8ba4\u8bc1\u63d2\u4ef6\u5e76\u6e05\u7a7a\u5bc6\u7801<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>-- \u5fc5\u987b\u6700\u5148\u6267\u884c\uff0c\u5426\u5219\u65e0\u6cd5\u4fee\u6539\u7528\u6237\u8868\nFLUSH PRIVILEGES;\n\n-- \u67e5\u770b\u5f53\u524d root \u7528\u6237\u72b6\u6001\nSELECT User, Host, plugin, authentication_string FROM mysql.user WHERE User='root';\n-- \u6211\u8fd9\u91cc\u9519\u8bef\u7684\u4fee\u6539\u4e86\u63d2\u4ef6\u6240\u4ee5\u9700\u8981\u8fd9\u6837\u6267\u884c\n-- \u4fee\u590d\uff1a\u5c06 plugin \u6539\u4e3a MySQL 8 \u9ed8\u8ba4\u7684 caching_sha2_password\uff0c\u5e76\u6e05\u7a7a\u5bc6\u7801\nUPDATE mysql.user SET plugin='caching_sha2_password', authentication_string='' WHERE User='root';\n\n-- \u4e00\u822c\u6267\u884c\nUPDATE mysql.user SET authentication_string='' WHERE User='root'\n\n-- \u518d\u6b21\u5237\u65b0\u6743\u9650\nFLUSH PRIVILEGES;\n\n-- \u9000\u51fa\nEXIT;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F286C4\">--<\/span><span style=\"color: #F6F6F4\"> \u5fc5\u987b\u6700\u5148\u6267\u884c\uff0c\u5426\u5219\u65e0\u6cd5\u4fee\u6539\u7528\u6237\u8868<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">FLUSH PRIVILEGES;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">--<\/span><span style=\"color: #F6F6F4\"> \u67e5\u770b\u5f53\u524d root \u7528\u6237\u72b6\u6001<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">SELECT User, Host, plugin, authentication_string FROM mysql.user WHERE User<\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">root<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">--<\/span><span style=\"color: #F6F6F4\"> \u6211\u8fd9\u91cc\u9519\u8bef\u7684\u4fee\u6539\u4e86\u63d2\u4ef6\u6240\u4ee5\u9700\u8981\u8fd9\u6837\u6267\u884c<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">--<\/span><span style=\"color: #F6F6F4\"> \u4fee\u590d\uff1a\u5c06 plugin \u6539\u4e3a MySQL <\/span><span style=\"color: #BF9EEE\">8<\/span><span style=\"color: #F6F6F4\"> \u9ed8\u8ba4\u7684 caching_sha2_password\uff0c\u5e76\u6e05\u7a7a\u5bc6\u7801<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">UPDATE mysql.user SET plugin<\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">caching_sha2_password<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">, authentication_string<\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #DEE492\">&#39;&#39;<\/span><span style=\"color: #F6F6F4\"> WHERE User<\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">root<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">--<\/span><span style=\"color: #F6F6F4\"> \u4e00\u822c\u6267\u884c<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">UPDATE mysql.user SET authentication_string<\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #DEE492\">&#39;&#39;<\/span><span style=\"color: #F6F6F4\"> WHERE User<\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">root<\/span><span style=\"color: #DEE492\">&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">--<\/span><span style=\"color: #F6F6F4\"> \u518d\u6b21\u5237\u65b0\u6743\u9650<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">FLUSH PRIVILEGES;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">--<\/span><span style=\"color: #F6F6F4\"> \u9000\u51fa<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">EXIT;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e94\u6b65\uff1a\u6b63\u5e38\u91cd\u542f MySQL<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>sudo systemctl start mysql<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F6F6F4\">sudo systemctl start mysql<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u516d\u6b65\uff1a\u7528\u7a7a\u5bc6\u7801\u767b\u5f55\u5e76\u8bbe\u7f6e\u65b0\u5bc6\u7801<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>mysql -uroot -p\n-- \u8bbe\u7f6e\u65b0\u5bc6\u7801\uff08MySQL 8 \u4f1a\u81ea\u52a8\u4f7f\u7528 caching_sha2_password\uff09\n-- \u6ce8\u610f\u4f60\u7684root\u7684host\u662f\u4e0d\u662f`localhost`\uff0c\u6211\u7684\u662f`%`\nALTER USER 'root'@'localhost' IDENTIFIED BY 'YourStrongPassword123!';\n\n-- \u5237\u65b0\u6743\u9650\nFLUSH PRIVILEGES;\n\n-- \u9000\u51fa\nEXIT;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F6F6F4\">mysql <\/span><span style=\"color: #F286C4\">-<\/span><span style=\"color: #F6F6F4\">uroot <\/span><span style=\"color: #F286C4\">-<\/span><span style=\"color: #F6F6F4\">p<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">--<\/span><span style=\"color: #F6F6F4\"> \u8bbe\u7f6e\u65b0\u5bc6\u7801\uff08MySQL <\/span><span style=\"color: #BF9EEE\">8<\/span><span style=\"color: #F6F6F4\"> \u4f1a\u81ea\u52a8\u4f7f\u7528 caching_sha2_password\uff09<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">--<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #62E884\">\u6ce8\u610f\u4f60\u7684root\u7684host\u662f\u4e0d\u662f<\/span><span style=\"color: #E7EE98\">`localhost`<\/span><span style=\"color: #F6F6F4\">\uff0c<\/span><span style=\"color: #62E884\">\u6211\u7684\u662f<\/span><span style=\"color: #E7EE98\">`%`<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">ALTER USER <\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">root<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">@<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">localhost<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\"> IDENTIFIED BY <\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">YourStrongPassword123!<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">--<\/span><span style=\"color: #F6F6F4\"> \u5237\u65b0\u6743\u9650<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">FLUSH PRIVILEGES;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">--<\/span><span style=\"color: #F6F6F4\"> \u9000\u51fa<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">EXIT;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e03\u6b65\uff1a\u8fd8\u539f\u914d\u7f6e\u6587\u4ef6\u5e76\u767b\u5f55<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly># \u53bb\u6389skip-grant-tables\u540e\nsudo systemctl restart mysql\n\nmysql -uroot -p<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F6F6F4\"># \u53bb\u6389skip<\/span><span style=\"color: #F286C4\">-<\/span><span style=\"color: #F6F6F4\">grant<\/span><span style=\"color: #F286C4\">-<\/span><span style=\"color: #F6F6F4\">tables\u540e<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">sudo systemctl restart mysql<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">mysql <\/span><span style=\"color: #F286C4\">-<\/span><span style=\"color: #F6F6F4\">uroot <\/span><span style=\"color: #F286C4\">-<\/span><span style=\"color: #F6F6F4\">p<\/span><\/span><\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u6b21\u771f\u5b9e\u7684\u6392\u9519\u8bb0\u5f55\uff1a\u4ece\u5404\u79cd\u62a5\u9519\u5230\u6700\u7ec8\u89e3\u51b3\uff0c\u6db5\u76d6 MySQL 8.0 \u4e0e\u65e7\u7248\u672c\u7684\u6838\u5fc3\u5dee\u5f02 \u524d\u8a00 \u5982\u679c\u4f60\u8fd8\u5728\u4f7f\u7528  &#8230; <a title=\"MySQL 8.4 \u5fd8\u8bb0root\u5bc6\u7801\u600e\u4e48\u529e\" class=\"read-more\" href=\"https:\/\/fennubird.cn\/index.php\/2026\/05\/25\/mysql-8-4-%e5%bf%98%e8%ae%b0root%e5%af%86%e7%a0%81%e6%80%8e%e4%b9%88%e5%8a%9e\/\" aria-label=\"\u9605\u8bfb MySQL 8.4 \u5fd8\u8bb0root\u5bc6\u7801\u600e\u4e48\u529e\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":141,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,23],"tags":[],"class_list":["post-139","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-mysql"],"_links":{"self":[{"href":"https:\/\/fennubird.cn\/index.php\/wp-json\/wp\/v2\/posts\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fennubird.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fennubird.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fennubird.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fennubird.cn\/index.php\/wp-json\/wp\/v2\/comments?post=139"}],"version-history":[{"count":0,"href":"https:\/\/fennubird.cn\/index.php\/wp-json\/wp\/v2\/posts\/139\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fennubird.cn\/index.php\/wp-json\/wp\/v2\/media\/141"}],"wp:attachment":[{"href":"https:\/\/fennubird.cn\/index.php\/wp-json\/wp\/v2\/media?parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fennubird.cn\/index.php\/wp-json\/wp\/v2\/categories?post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fennubird.cn\/index.php\/wp-json\/wp\/v2\/tags?post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}