{"id":608,"date":"2025-01-23T07:52:12","date_gmt":"2025-01-22T23:52:12","guid":{"rendered":"http:\/\/cnitw.com\/?p=608"},"modified":"2025-01-23T07:52:12","modified_gmt":"2025-01-22T23:52:12","slug":"wordpress-%e6%95%b0%e6%8d%ae%e5%ba%93%e6%81%a2%e5%a4%8d%e9%94%99%e8%af%af%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.cnitw.com\/?p=608","title":{"rendered":"WordPress \u6570\u636e\u5e93\u6062\u590d\u9519\u8bef\u89e3\u51b3\u529e\u6cd5"},"content":{"rendered":"\n<p>\u9519\u8bef<br>SQL \u67e5\u8be2\uff1a<\/p>\n\n\n\n<p>CREATE TABLE <code>wp_baiduseo_ai_lishi<\/code> (<br><code>id<\/code> bigint(20) NOT NULL AUTO_INCREMENT,<br><code>hexin<\/code> varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL,<br><code>guangjianci<\/code> varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL,<br><code>riqi<\/code> timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,<br><code>neirong<\/code> text COLLATE utf8mb4_unicode_520_ci,<br><code>jifen<\/code> varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT &#8216;-0.35&#8217;,<br>UNIQUE KEY <code>id<\/code> (<code>id<\/code>)<br>) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;<br>MySQL \u8fd4\u56de\uff1a \u6587\u6863<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">1273 &#8211; Unknown collation: &#8216;utf8mb4_unicode_520_ci&#8217;<\/h1>\n\n\n\n<h3 class=\"wp-block-heading\">\u9519\u8bef\u70b9\u5206\u6790<\/h3>\n\n\n\n<p>\u6b64\u9519\u8bef <code>#1273 - Unknown collation: 'utf8mb4_unicode_520_ci'<\/code> \u8868\u660e MySQL \u4e0d\u652f\u6301 <code>utf8mb4_unicode_520_ci<\/code> \u8fd9\u79cd\u5b57\u7b26\u96c6\u6392\u5e8f\u89c4\u5219\u3002\u8fd9\u5f80\u5f80\u662f\u56e0\u4e3a\u4f60\u6240\u7528\u7684 MySQL \u7248\u672c\u8fc7\u4f4e\uff0c<code>utf8mb4_unicode_520_ci<\/code> \u662f MySQL 8.0 \u53ca\u66f4\u9ad8\u7248\u672c\u624d\u652f\u6301\u7684\u6392\u5e8f\u89c4\u5219\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4f18\u5316\u70b9\u5efa\u8bae<\/h3>\n\n\n\n<p>\u4f60\u53ef\u4ee5\u628a <code>utf8mb4_unicode_520_ci<\/code> \u66ff\u6362\u6210\u4f4e\u7248\u672c MySQL \u4e5f\u652f\u6301\u7684\u6392\u5e8f\u89c4\u5219\uff0c\u50cf <code>utf8mb4_unicode_ci<\/code> \u8fd9\u7c7b\u901a\u7528\u7684\u6392\u5e8f\u89c4\u5219\u5c31\u53ef\u4ee5\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4fee\u6539\u540e\u7684\u4ee3\u7801<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE `wp_baiduseo_ai_lishi` (\n  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n  `hexin` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n  `guangjianci` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n  `riqi` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n  `neirong` text COLLATE utf8mb4_unicode_ci,\n  `jifen` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '-0.35',\n  UNIQUE KEY `id` (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;<\/code><\/pre>\n\n\n\n<p>\u4fee\u6539\u540e\u7684\u4ee3\u7801<strong>\u628a\u6240\u6709 <code>utf8mb4_unicode_520_ci<\/code> \u90fd\u66ff\u6362\u6210\u4e86 <code>utf8mb4_unicode_ci<\/code><\/strong>\uff0c\u8fd9\u6837\u5c31\u80fd\u5728\u8f83\u4f4e\u7248\u672c\u7684 MySQL \u4e2d\u6267\u884c\u8be5 SQL \u8bed\u53e5\u4e86\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u8bf4\u660e\uff1a\u662f\u4f60\u5f53\u524d\u4f7f\u7528\u7684 MySQL \u7248\u672c\u4f4e\u3002<\/p>\n\n\n\n<p><code>utf8mb4_unicode_520_ci<\/code> \u662f MySQL 8.0 \u5f15\u5165\u7684\u6392\u5e8f\u89c4\u5219\uff0c\u82e5\u4f60\u5728\u6267\u884c SQL \u8bed\u53e5\u65f6\u6536\u5230 <code>#1273 - Unknown collation: 'utf8mb4_unicode_520_ci'<\/code> \u62a5\u9519\uff0c\u8fd9\u610f\u5473\u7740\u4f60\u5f53\u524d\u7684 MySQL \u7248\u672c\u4f4e\u4e8e 8.0\uff0c\u65e0\u6cd5\u8bc6\u522b\u8be5\u6392\u5e8f\u89c4\u5219\u3002<\/p>\n\n\n\n<p>\u81f3\u4e8e\u4e4b\u524d\u7684\u7248\u672c\uff0c\u63a8\u6d4b\u4e4b\u524d\u5907\u4efd\u6570\u636e\u5e93\u7684\u73af\u5883\u53ef\u80fd\u4f7f\u7528\u7684\u662f MySQL 8.0 \u6216\u66f4\u9ad8\u7248\u672c\uff0c\u6240\u4ee5\u5907\u4efd\u51fa\u6765\u7684 SQL \u6587\u4ef6\u91cc\u5305\u542b\u4e86 <code>utf8mb4_unicode_520_ci<\/code> \u6392\u5e8f\u89c4\u5219\u3002\u5f53\u4f60\u5c1d\u8bd5\u5728\u4f4e\u7248\u672c MySQL \u73af\u5883\u4e2d\u6062\u590d\u8fd9\u4e2a\u5907\u4efd\u65f6\uff0c\u5c31\u51fa\u73b0\u4e86\u4e0d\u517c\u5bb9\u7684\u95ee\u9898\u3002<\/p>\n\n\n\n<p>\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5f53\u524d MySQL \u7248\u672c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT VERSION();<\/code><\/pre>\n\n\n\n<p>\u82e5\u7248\u672c\u4f4e\u4e8e 8.0\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u5347\u7ea7 MySQL \u5230 8.0 \u53ca\u4ee5\u4e0a\u7248\u672c\uff0c\u6216\u8005\u6309\u7167\u4e4b\u524d\u5efa\u8bae\u7684\u90a3\u6837\uff0c\u5c06 SQL \u8bed\u53e5\u4e2d\u7684 <code>utf8mb4_unicode_520_ci<\/code> \u66ff\u6362\u4e3a <code>utf8mb4_unicode_ci<\/code> \u6765\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">\u5982\u4f55\u786e\u5b9a\u6570\u636e\u5e93\u5907\u4efd\u6587\u4ef6\u662f\u5728\u54ea\u4e2a\u7248\u672c\u7684 MySQL \u73af\u5883\u4e0b\u751f\u6210\u7684\uff1f<\/mark><\/p>\n\n\n\n<p>\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\u6765\u786e\u5b9a\u6570\u636e\u5e93\u5907\u4efd\u6587\u4ef6\u662f\u5728\u54ea\u4e2a\u7248\u672c\u7684 MySQL \u73af\u5883\u4e0b\u751f\u6210\u7684\uff1a<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u67e5\u770b\u5907\u4efd\u6587\u4ef6\u4e2d\u7684\u7248\u672c\u4fe1\u606f<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5907\u4efd\u6587\u4ef6\u4e3a SQL \u683c\u5f0f<\/strong>\uff1a\u901a\u5e38 SQL \u5907\u4efd\u6587\u4ef6\u5f00\u5934\u4f1a\u5305\u542b\u4e00\u4e9b\u6ce8\u91ca\u4fe1\u606f\uff0c\u91cc\u9762\u53ef\u80fd\u4f1a\u6709 MySQL \u7248\u672c\u53f7\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982 Windows \u4e0b\u7684\u8bb0\u4e8b\u672c\u3001Notepad++\uff0cLinux \u4e0b\u7684 vim\u3001nano \u7b49\uff09\u6253\u5f00\u5907\u4efd\u6587\u4ef6\uff0c\u641c\u7d22\u7c7b\u4f3c <code>MySQL dump<\/code> \u6216\u8005 <code>Server version<\/code> \u7684\u5173\u952e\u5b57\u3002\u793a\u4f8b\u5982\u4e0b\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>-- MySQL dump 10.13  Distrib 5.7.36, for Linux (x86_64)\n-- Server version    5.7.36<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8ff0\u793a\u4f8b\u8868\u660e\u8be5\u5907\u4efd\u6587\u4ef6\u662f\u5728 MySQL 5.7.36 \u7248\u672c\u4e0b\u751f\u6210\u7684\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u5206\u6790\u5907\u4efd\u6587\u4ef6\u4e2d\u7684\u7279\u5b9a\u8bed\u6cd5\u548c\u7279\u6027<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6392\u5e8f\u89c4\u5219<\/strong>\uff1a\u4e0d\u540c\u7248\u672c\u7684 MySQL \u652f\u6301\u7684\u6392\u5e8f\u89c4\u5219\u6709\u6240\u4e0d\u540c\u3002\u4f8b\u5982\uff0c<code>utf8mb4_unicode_520_ci<\/code> \u662f MySQL 8.0 \u53ca\u4ee5\u4e0a\u7248\u672c\u652f\u6301\u7684\u6392\u5e8f\u89c4\u5219\uff0c\u5982\u679c\u5907\u4efd\u6587\u4ef6\u4e2d\u4f7f\u7528\u4e86\u8fd9\u4e2a\u6392\u5e8f\u89c4\u5219\uff0c\u90a3\u4e48\u5907\u4efd\u73af\u5883\u5927\u6982\u7387\u662f MySQL 8.0 \u6216\u66f4\u9ad8\u7248\u672c\uff1b\u800c\u5982\u679c\u4f7f\u7528\u7684\u662f <code>utf8mb4_unicode_ci<\/code>\uff0c\u5219\u8f83\u65e7\u7248\u672c\uff08\u5982 MySQL 5.5 \u53ca\u4ee5\u4e0a\uff09\u4e5f\u652f\u6301\u3002<\/li>\n\n\n\n<li><strong>\u65b0\u7279\u6027\u8bed\u6cd5<\/strong>\uff1a\u67d0\u4e9b\u65b0\u7684 SQL \u8bed\u6cd5\u6216\u7279\u6027\u4ec5\u5728\u7279\u5b9a\u7248\u672c\u4e4b\u540e\u624d\u88ab\u652f\u6301\u3002\u6bd4\u5982\uff0c\u7a97\u53e3\u51fd\u6570\u662f MySQL 8.0 \u5f15\u5165\u7684\uff0c\u5982\u679c\u5907\u4efd\u6587\u4ef6\u4e2d\u5305\u542b\u7a97\u53e3\u51fd\u6570\u7684\u4f7f\u7528\uff0c\u90a3\u4e48\u5907\u4efd\u73af\u5883\u5fc5\u7136\u662f MySQL 8.0 \u6216\u66f4\u9ad8\u7248\u672c\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u68c0\u67e5\u5907\u4efd\u5de5\u5177\u7684\u65e5\u5fd7\u6216\u5143\u6570\u636e<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u4f7f\u7528\u7684\u5907\u4efd\u5de5\u5177<\/strong>\uff1a\u5982\u679c\u4f60\u662f\u4f7f\u7528\u7279\u5b9a\u7684\u5907\u4efd\u5de5\u5177\uff08\u5982 mysqldump\u3001phpMyAdmin \u7b49\uff09\u6765\u8fdb\u884c\u6570\u636e\u5e93\u5907\u4efd\uff0c\u8fd9\u4e9b\u5de5\u5177\u53ef\u80fd\u4f1a\u5728\u65e5\u5fd7\u6587\u4ef6\u6216\u8005\u5907\u4efd\u6587\u4ef6\u7684\u5143\u6570\u636e\u4e2d\u8bb0\u5f55\u5907\u4efd\u65f6\u4f7f\u7528\u7684 MySQL \u7248\u672c\u4fe1\u606f\u3002\n<ul class=\"wp-block-list\">\n<li><strong>mysqldump<\/strong>\uff1a\u5728\u4f7f\u7528 mysqldump \u8fdb\u884c\u5907\u4efd\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b\u5176\u547d\u4ee4\u6267\u884c\u7684\u8f93\u51fa\u65e5\u5fd7\u6765\u83b7\u53d6\u76f8\u5173\u4fe1\u606f\u3002\u4f8b\u5982\uff0c\u5728\u547d\u4ee4\u884c\u4e2d\u6267\u884c <code>mysqldump<\/code> \u547d\u4ee4\u540e\uff0c\u5176\u8f93\u51fa\u53ef\u80fd\u4f1a\u5305\u542b MySQL \u7248\u672c\u4fe1\u606f\u3002<\/li>\n\n\n\n<li><strong>phpMyAdmin<\/strong>\uff1a\u5728 phpMyAdmin \u4e2d\u8fdb\u884c\u5907\u4efd\u65f6\uff0c\u5b83\u53ef\u80fd\u4f1a\u5728\u5907\u4efd\u6587\u4ef6\u7684\u6ce8\u91ca\u90e8\u5206\u6216\u8005\u5728 phpMyAdmin \u7684\u64cd\u4f5c\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u5907\u4efd\u65f6\u7684 MySQL \u7248\u672c\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">4. \u5c1d\u8bd5\u5bfc\u5165\u5230\u4e0d\u540c\u7248\u672c\u7684 MySQL \u73af\u5883\u4e2d<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6d4b\u8bd5\u5bfc\u5165<\/strong>\uff1a\u53ef\u4ee5\u9009\u62e9\u51e0\u4e2a\u4e0d\u540c\u7248\u672c\u7684 MySQL \u73af\u5883\uff0c\u5c1d\u8bd5\u5c06\u5907\u4efd\u6587\u4ef6\u5bfc\u5165\u5176\u4e2d\u3002\u5982\u679c\u5728\u67d0\u4e2a\u7248\u672c\u4e2d\u5bfc\u5165\u6210\u529f\u4e14\u6ca1\u6709\u51fa\u73b0\u56e0\u7248\u672c\u4e0d\u517c\u5bb9\u5bfc\u81f4\u7684\u9519\u8bef\uff0c\u90a3\u4e48\u8be5\u5907\u4efd\u6587\u4ef6\u5f88\u53ef\u80fd\u662f\u5728\u76f8\u8fd1\u6216\u66f4\u4f4e\u7248\u672c\u7684 MySQL \u73af\u5883\u4e0b\u751f\u6210\u7684\u3002\u4e0d\u8fc7\u8fd9\u79cd\u65b9\u6cd5\u6bd4\u8f83\u7e41\u7410\uff0c\u4e14\u53ef\u80fd\u4f1a\u5bf9\u6d4b\u8bd5\u73af\u5883\u7684\u6570\u636e\u9020\u6210\u5f71\u54cd\uff0c\u9700\u8981\u8c28\u614e\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>\u603b\u7ed3\uff1a\u628a SQL \u6587\u4ef6\u91cc\u7684\u00a0<code>utf8mb4_unicode_520_ci<\/code>\u00a0\u66ff\u6362\u6210\u00a0<code>utf8mb4_unicode_ci<\/code>\uff0c\u8fd9\u6837\u5c31\u80fd\u5728\u5f53\u524d\u7684 MySQL \u73af\u5883\u4e2d\u6b63\u5e38\u5bfc\u5165\u5907\u4efd\u6570\u636e\u4e86\u3002<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9519\u8befSQL \u67e5\u8be2\uff1a CREATE TABLE wp_baiduseo_ai_lishi (id bigint(20) NOT NULL AUTO_INCREMENT,hexin varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL,guangjianci varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL,riqi timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,neirong text COLLATE utf8mb4_unicode_520_ci,jifen varchar(255) COLLATE&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-608","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"_links":{"self":[{"href":"http:\/\/www.cnitw.com\/index.php?rest_route=\/wp\/v2\/posts\/608","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.cnitw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.cnitw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.cnitw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.cnitw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=608"}],"version-history":[{"count":0,"href":"http:\/\/www.cnitw.com\/index.php?rest_route=\/wp\/v2\/posts\/608\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.cnitw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.cnitw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=608"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.cnitw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}