{"id":401,"date":"2008-01-31T12:32:07","date_gmt":"2008-01-31T04:32:07","guid":{"rendered":"http:\/\/www.banbanli.net\/?p=401"},"modified":"2008-01-31T12:32:07","modified_gmt":"2008-01-31T04:32:07","slug":"mysql-5x","status":"publish","type":"post","link":"http:\/\/www.banbanli.net\/blog\/?p=401","title":{"rendered":"Mysql 5.x"},"content":{"rendered":"<p>Server \u5fa9\u539f\u9084\u7b97\u9806\u5229\uff0cWeb \u4e00\u4e0b\u5b50\u5c31\u5f04\u597d\uff0c\u63a5\u4e0b\u4f86\u5c31\u662f\u8981\u628a\u5099\u4efd\u7684Mysql database \u5fa9\u539f\u56de\u53bb\uff0c\u4e5f\u597d\u4e86\uff0c\u6253\u958b\u9996\u9801wordpress system \uff0c\u5929\u963f\uff5e\u600e\u9ebc\u6703\u662f\u4e82\u78bc\u963f -_-<\/p>\n<p>\u554f\u4e86\u4e00\u4e0b\u5495\u72d7\u5927\u795e\uff0c\u539f\u4f86\u662fMysql 4.x \u9810\u8a2d\u9069\u7528Latin1 character set, WordPress \u9069\u7528utf8, \u704c\u4e86CentOS 5, \u4ed6\u7684Mysql \u5df2\u7d93\u66f4\u65b0\u52305.x\u4e86\uff0c\u9810\u8a2d\u662futf8, \u800c\u6211\u5728\u6c92\u6709\u4f5c\u9069\u7576\u7684character set \u8f49\u63db\u4e0b\uff0c\u5c31\u7528utf8 \u53bb\u8b80Latin1\u7684\u7de8\u78bc\uff0c\u65bc\u662f\u5c31\u4e00\u72d7\u7968\u7684\u5927\u4fbf\u5410\u7d66\u4f60 -_-<\/p>\n<p>\u6478\u4e86\u5169\u5929\uff0c\u770b\u4e86\u7121\u6578\u7684\u4eba\u7d66\u51fa\u4f86\u7684solution, \u5927\u6982\u77e5\u9053\u554f\u984c\u6240\u5728\uff0c\u6240\u4ee5\u7528AppSev \u5728\u516c\u53f8\u96fb\u8166\u6a21\u64ec\uff0cMyphpadmin\u4f3c\u4e4e\u6c92\u6709\u8fa6\u6cd5\u63d0\u4f9bdefault character set output \u7684\u6307\u4ee4\uff0c\u6240\u4ee5\u53ea\u80fd\u5728command line \u4e0b\u57f7\u884c<\/p>\n<p><code>&gt;mysqldump -u root -p --default-character-set=latin1 --add-drop-table databasename &gt; outputfile<\/code><\/p>\n<p>\u8f38\u51fa\u5f8c\u5c31\u53ef\u4ee5\u7528vim\uff08:set enc=utf8\uff09\uff08\u6211\u5728\u6688\u5012XP \u7528Cygwin\u770b\u5230\u7684\u9084\u662f\u4e82\u78bc\uff09 or <a href=\"http:\/\/www.emeditor.com\/\">EmEditor <\/a>(\u81ea\u5df1\u6253\u958b\u5c31\u8a8d\u51fa\u662futf8\u7684\u683c\u5f0f) \u4f86\u770b wordpress \u6240\u5132\u5b58\u7684utf8 \u7684\u5167\u5bb9\u3002<\/p>\n<p>\u63a5\u4e0b\u4f86\u628a\u6240\u6709\u7684latin1 \u63db\u6210utf8<br \/>\n<code>\/*!40101 SET NAMES latin1 *\/;<br \/>\nENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;<\/code><br \/>\n\u9019\u6a23\u5c31\u5b8c\u6210\u4e86\u7de8\u78bc\u7684\u8f49\u63db\u4e86\u3002<\/p>\n<p>\u7528phpmyadmin\u958b\u4e00\u500b\u65b0\u7684\u8cc7\u6599\u5eab\uff0c<br \/>\nMySQL \u9023\u7dda\u6821\u5c0d \u9078utf8_unicode_ci<\/p>\n<p>\u518d\u628a\u525b\u525b\u8f49\u597d\u7684\u6a94\u6848import \u9032\u53bb\u9019\u500bdatabase<br \/>\n<code>&gt;mysql -u root -p databasename &lt; utf8.sql<\/code><\/p>\n<p>\u9019\u6a23\u5c31\u5b8c\u6210\u5566\uff5e<br \/>\n\u518d\u628a\u4ed6import \u5230database \u88e1\u9762\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Server \u5fa9\u539f\u9084\u7b97\u9806\u5229\uff0cWeb \u4e00\u4e0b\u5b50\u5c31\u5f04\u597d\uff0c\u63a5\u4e0b\u4f86\u5c31\u662f\u8981\u628a\u5099\u4efd\u7684Mysql database \u5fa9\u539f\u56de\u53bb\uff0c\u4e5f\u597d\u4e86\uff0c\u6253\u958b\u9996\u9801wordpress system \uff0c\u5929\u963f\uff5e\u600e\u9ebc\u6703\u662f\u4e82\u78bc\u963f -_- \u554f\u4e86\u4e00\u4e0b\u5495\u72d7\u5927\u795e\uff0c\u539f\u4f86\u662fMysql 4.x \u9810\u8a2d\u9069\u7528Latin1 character set, WordPress \u9069\u7528utf8, \u704c\u4e86CentOS 5, \u4ed6\u7684Mysql \u5df2\u7d93\u66f4\u65b0\u52305.x\u4e86\uff0c\u9810\u8a2d\u662futf8, \u800c\u6211\u5728\u6c92\u6709\u4f5c\u9069\u7576\u7684character set \u8f49\u63db\u4e0b\uff0c\u5c31\u7528utf8 \u53bb\u8b80Latin1\u7684\u7de8\u78bc\uff0c\u65bc\u662f\u5c31\u4e00\u72d7\u7968\u7684\u5927\u4fbf\u5410\u7d66\u4f60 -_- \u6478\u4e86\u5169\u5929\uff0c\u770b\u4e86\u7121\u6578\u7684\u4eba\u7d66\u51fa\u4f86\u7684solution, \u5927\u6982\u77e5\u9053\u554f\u984c\u6240\u5728\uff0c\u6240\u4ee5\u7528AppSev \u5728\u516c\u53f8\u96fb\u8166\u6a21\u64ec\uff0cMyphpadmin\u4f3c\u4e4e\u6c92\u6709\u8fa6\u6cd5\u63d0\u4f9bdefault character set output \u7684\u6307\u4ee4\uff0c\u6240\u4ee5\u53ea\u80fd\u5728command line \u4e0b\u57f7\u884c &gt;mysqldump -u root -p &#8211;default-character-set=latin1 &#8211;add-drop-table databasename &gt; outputfile \u8f38\u51fa\u5f8c\u5c31\u53ef\u4ee5\u7528vim\uff08:set enc=utf8\uff09\uff08\u6211\u5728\u6688\u5012XP \u7528Cygwin\u770b\u5230\u7684\u9084\u662f\u4e82\u78bc\uff09 or EmEditor (\u81ea\u5df1\u6253\u958b\u5c31\u8a8d\u51fa\u662futf8\u7684\u683c\u5f0f) \u4f86\u770b wordpress \u6240\u5132\u5b58\u7684utf8 \u7684\u5167\u5bb9\u3002 \u63a5\u4e0b\u4f86\u628a\u6240\u6709\u7684latin1 \u63db\u6210utf8 \/*!40101 &hellip; <a href=\"http:\/\/www.banbanli.net\/blog\/?p=401\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Mysql 5.x<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-401","post","type-post","status-publish","format-standard","hentry","category-daily"],"_links":{"self":[{"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=401"}],"version-history":[{"count":0,"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/401\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=401"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.banbanli.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}