{"id":70,"date":"2024-06-26T15:30:58","date_gmt":"2024-06-26T07:30:58","guid":{"rendered":"http:\/\/192.168.5.24\/?p=70"},"modified":"2025-01-19T11:48:37","modified_gmt":"2025-01-19T03:48:37","slug":"windows-server-%e5%ae%89%e8%a3%85mysql","status":"publish","type":"post","link":"https:\/\/bigvip.dpdns.org\/?p=70","title":{"rendered":"Windows Server  \u5b89\u88c5MySQL Server"},"content":{"rendered":"\n<p>1\u3001\u5b89\u88c5mysql\u524d\u5fc5\u987b\u5148\u5b89\u88c5\u4f9d\u8d56 Microsoft Visual C++ 2019 Redistributable\u3002<\/p>\n\n\n\n<p>2\u3001mysql 8.4 \u91c7\u7528cachng_sha2_password\u8fdb\u884c\u7528\u6237\u7684\u5bc6\u7801\u52a0\u5bc6<\/p>\n\n\n\n<p>mysql&gt; show plugins;<br>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+<br>| Name | Status | Type | Library | License |<br>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+<br>| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |<br>| sha256_password | ACTIVE | AUTHENTICATION | NULL | GPL |<br>| caching_sha2_password | ACTIVE | AUTHENTICATION | NULL | GPL |<br>\u2026\u2026<br>| mysql_native_password | <strong>DISABLED<\/strong>| AUTHENTICATION | NULL | GPL |<br>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+<\/p>\n\n\n\n<p>\u90e8\u5206\u7b2c\u4e09\u65b9\u7684mysql\u5ba2\u6237\u7aef\u4e0d\u652f\u6301\u8fd9\u4e2a\u52a0\u5bc6\u65b9\u5f0f\u53ef\u4ee5\u4fee\u6539\u4e3amysql 8.0.4\u4e4b\u524d\u7684myslq_native_password,\u4fee\u6539\u65b9\u6cd5\u5982\u4e0b\uff1a\u5728:\\ProgramData\\MySQL\\MySQL Server 8.4 \u4e0b\u7684my.ini\u6587\u4ef6\u4e2d\u4fee\u6539\u4e00\u4e0b\u5185\u5bb9\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;mysqld]\nmysql_native_password=on<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u91cd\u542fmysql84\u670d\u52a1\uff0c\u5728\u5f00\u59cb\u83dc\u5355\u6253\u5f00&#8221;MySQL 8.4 Command Line Client&#8221;\u5373\u53ef\u6253\u5f00\u6570\u636e\u5e93\u7684\u547d\u4ee4\u884c\u3002<\/p>\n\n\n\n<p>mysql&gt; show plugins;<br>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+<br>| Name | Status | Type | Library | License |<br>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+<br>| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |<br>| sha256_password | ACTIVE | AUTHENTICATION | NULL | GPL |<br>| caching_sha2_password | ACTIVE | AUTHENTICATION | NULL | GPL |<br>| sha2_cache_cleaner | ACTIVE | AUDIT | NULL | GPL |<br>\u2026\u2026<br>| mysql_native_password | <strong>ACTIVE<\/strong> | AUTHENTICATION | NULL | GPL |<br>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+<br>48 rows in set (0.00 sec)<\/p>\n\n\n\n<p>3\u3001\u7528\u6237\u7ba1\u7406\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u521b\u5efa\u7528\u6237\uff1a\n   create user 'pig'@'%' identified with mysql_native_password by 'password123'\uff1b\n\u4fee\u6539\u5bc6\u7801\uff1a\n   alter user 'pig'@'%' identified with mysql_native_password by 'password123'\uff1b\n        \u6216\u8005\uff1a\n   SET PASSWORD FOR 'username'@'host' = PASSWORD('newpassword');\n\u7528\u6237\u6388\u6743\uff1a\n   grant all on *.* to 'pig'@'%'\uff1b\n\u67e5\u770b\u6388\u6743\u60c5\u51b5\uff1a\n   show grants for 'pig'@'%' \\G\uff1b\n\u79fb\u9664\u6388\u6743\uff1a\n   revoke all on *.* from 'pig'@'%'\uff1b<\/code><\/pre>\n\n\n\n<p>\u6570\u636e\u5e93\u7684\u5907\u4efd\u8fd8\u539f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u5907\u4efd\uff1a\n  mysqldump -uroot -p --databases db1 db2 &gt; \/path\/to\/db_backup.sql;\n--\u5907\u4efddb1\u3001db2\u6570\u636e\u5e93\u3002\n  myslqdump -uroot -p db1 tb1 tb2 &gt; \/path\/to\/db_backup.sql;\n--\u5907\u4efddb1\u4e2d\u7684tb1\u3001tb2\u8868\u3002\n\u5907\u4efd\u6240\u6709\u6570\u636e\u5e93\uff1a\n  mysqldump -uroot -p --all-database &gt; \/path\/to\/db_backup.sql;\n\u8fd8\u539f\u6570\u636e\u5e93\uff1a\n  mysql -uroot -p &lt; \/path\/to\/db_backup.sql;\n--\u8fd8\u539f\u6570\u636e\u5e93\u53ef\u4ee5\u4e0d\u6307\u5b9a\u8fd8\u539f\u54ea\u4e2a\u6570\u636e\u5e93<\/code><\/pre>\n\n\n\n<p>4\u3001\u91cd\u7f6e\u5bc6\u7801<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u4fee\u6539my.cnf\u6216\u8005my.ini\u6587\u4ef6\uff1a\n\u5728&#91;mysqld]\u4e0b\u589e\u52a0\u4e00\u884c\uff1a\nskip-grant-tables=true\n\u91cd\u542fmysqld\u670d\u52a1\n\u6b64\u523b\u4f7f\u7528\u7a7a\u5bc6\u7801\u5373\u53ef\u767b\u5f55\u6570\u636e\u5e93\uff0c\u7136\u540e\u6709\u547d\u4ee4\u4fee\u6539\u5bc6\u7801\u5373\u53ef<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u5b89\u88c5mysql\u524d\u5fc5\u987b\u5148\u5b89\u88c5\u4f9d\u8d56 Microsoft Visual C++ 2019 Redistribut [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,35],"tags":[15,16,17],"class_list":["post-70","post","type-post","status-publish","format-standard","hentry","category-windows","category-35","tag-mysql","tag-mysql_native_password","tag-17"],"_links":{"self":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/70","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=70"}],"version-history":[{"count":22,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/70\/revisions"}],"predecessor-version":[{"id":847,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/70\/revisions\/847"}],"wp:attachment":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=70"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=70"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}