{"id":3397,"date":"2019-06-04T11:05:56","date_gmt":"2019-06-04T03:05:56","guid":{"rendered":"https:\/\/damogame.cn\/wordpress\/?p=3397"},"modified":"2019-06-04T11:05:56","modified_gmt":"2019-06-04T03:05:56","slug":"mysql%e5%ad%97%e7%ac%a6%e9%9b%86%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/i007.cc\/wordpress\/archives\/3397","title":{"rendered":"MySQL\u5b57\u7b26\u96c6\u8be6\u89e3"},"content":{"rendered":"<p class=\"postTitle\"><a href=\"https:\/\/www.cnblogs.com\/wcwen1990\/p\/6917109.html\">\u539f\u6587\u5730\u5740<\/a><\/p>\n<div class=\"clear\"><\/div>\n<div class=\"postBody\">\n<div id=\"cnblogs_post_body\" class=\"blogpost-body\">\n<p>\u4e00\u3001\u5b57\u7b26\u96c6\u548c\u6821\u9a8c\u89c4\u5219<\/p>\n<p>\u5b57\u7b26\u96c6\u662f\u4e00\u5957\u7b26\u5408\u548c\u7f16\u7801\uff0c\u6821\u9a8c\u89c4\u5219\uff08collation\uff09\u662f\u5728\u5b57\u7b26\u96c6\u5185\u7528\u4e8e\u6bd4\u8f83\u5b57\u7b26\u7684\u4e00\u5957\u89c4\u5219\uff0c\u5373\u5b57\u7b26\u96c6\u7684\u6392\u5e8f\u89c4\u5219\u3002MySQL\u53ef\u4ee5\u4f7f\u7528\u5bf9\u79cd\u5b57\u7b26\u96c6\u548c\u68c0\u9a8c\u89c4\u5219\u6765\u7ec4\u7ec7\u5b57\u7b26\u3002<\/p>\n<p>MySQL\u670d\u52a1\u5668\u53ef\u4ee5\u652f\u6301\u591a\u79cd\u5b57\u7b26\u96c6\uff0c\u5728\u540c\u4e00\u53f0\u670d\u52a1\u5668\uff0c\u540c\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u751a\u81f3\u540c\u4e00\u4e2a\u8868\u7684\u4e0d\u540c\u5b57\u6bb5\u90fd\u53ef\u4ee5\u6307\u5b9a\u4f7f\u7528\u4e0d\u540c\u7684\u5b57\u7b26\u96c6\uff0c\u76f8\u6bd4oracle\u7b49\u5176\u4ed6\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u5728\u540c\u4e00\u4e2a\u6570\u636e\u5e93\u53ea\u80fd\u4f7f\u7528\u76f8\u540c\u7684\u5b57\u7b26\u96c6\uff0cMySQL\u660e\u663e\u5b58\u5728\u66f4\u5927\u7684\u7075\u6d3b\u6027\u3002<\/p>\n<p>\u6bcf\u79cd\u5b57\u7b26\u96c6\u90fd\u53ef\u80fd\u6709\u591a\u79cd\u6821\u5bf9\u89c4\u5219\uff0c\u5e76\u4e14\u90fd\u6709\u4e00\u4e2a\u9ed8\u8ba4\u7684\u6821\u5bf9\u89c4\u5219\uff0c\u5e76\u4e14\u6bcf\u4e2a\u6821\u5bf9\u89c4\u5219\u53ea\u662f\u9488\u5bf9\u67d0\u4e2a\u5b57\u7b26\u96c6\uff0c\u548c\u5176\u4ed6\u7684\u5b57\u7b26\u96c6\u4e48\u6709\u5173\u7cfb\u3002<\/p>\n<p>\u5728MySQL\u4e2d\uff0c\u5b57\u7b26\u96c6\u7684\u6982\u5ff5\u548c\u7f16\u7801\u65b9\u6848\u88ab\u770b\u505a\u662f\u540c\u4e49\u8bcd\uff0c\u4e00\u4e2a\u5b57\u7b26\u96c6\u662f\u4e00\u4e2a\u8f6c\u6362\u8868\u548c\u4e00\u4e2a\u7f16\u7801\u65b9\u6848\u7684\u7ec4\u5408\u3002<\/p>\n<p>Unicode\uff08Universal Code\uff09\u662f\u4e00\u79cd\u5728\u8ba1\u7b97\u673a\u4e0a\u4f7f\u7528\u7684\u5b57\u7b26\u7f16\u7801\u3002Unicode \u662f\u4e3a\u4e86\u89e3\u51b3\u4f20\u7edf\u7684\u5b57\u7b26\u7f16\u7801\u65b9\u6848\u7684\u5c40\u9650\u800c\u4ea7\u751f\u7684\uff0c\u5b83\u4e3a\u6bcf\u79cd\u8bed\u8a00\u4e2d\u7684\u6bcf\u4e2a\u5b57\u7b26\u8bbe\u5b9a\u4e86\u7edf\u4e00\u5e76\u4e14\u552f\u4e00\u7684\u4e8c\u8fdb\u5236\u7f16\u7801\uff0c\u4ee5\u6ee1\u8db3\u8de8\u8bed\u8a00\u3001\u8de8\u5e73\u53f0\u8fdb\u884c\u6587\u672c\u8f6c\u6362\u3001\u5904\u7406\u7684\u8981\u6c42\u3002Unicode\u5b58\u5728\u4e0d\u540c\u7684\u7f16\u7801\u65b9\u6848\uff0c\u5305\u62ecUtf-8\uff0cUtf-16\u548cUtf-32\u3002Utf\u8868\u793aUnicode Transformation Format\u3002<\/p>\n<h3>\u4e8c\u3001\u67e5\u770bmysql\u5b57\u7b26\u96c6\u65b9\u6cd5<\/h3>\n<h4>1\u3001\u67e5\u770bmysql\u670d\u52a1\u5668\u652f\u6301\u7684\u5b57\u7b26\u96c6<\/h4>\n<p>mysql&gt; show character set;<\/p>\n<p>mysql&gt; select * from information_schema.character_sets;<\/p>\n<p>mysql&gt; select character_set_name, default_collate_name, description, maxlen from<\/p>\n<p>information_schema.character_sets;<\/p>\n<h4>2\u3001\u67e5\u770b\u5b57\u7b26\u96c6\u7684\u6821\u5bf9\u89c4\u5219<\/h4>\n<p>mysql&gt; show collation;<\/p>\n<p>mysql&gt; show collation like &#8216;utf8&#8217;;<\/p>\n<p>mysql&gt; select * from information_schema.collations where collation_name like &#8216;utf8%&#8217;;<\/p>\n<h4>3\u3001\u67e5\u770b\u5f53\u524d\u6570\u636e\u5e93\u7684\u5b57\u7b26\u96c6<\/h4>\n<p>mysql&gt; show variables like &#8216;character%&#8217;;<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/p>\n<p>| Variable_name | Value |<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/p>\n<p>| character_set_client | utf8 |<\/p>\n<p>| character_set_connection | utf8 |<\/p>\n<p>| character_set_database | latin1 |<\/p>\n<p>| character_set_filesystem | utf8 |<\/p>\n<p>| character_set_results | utf8 |<\/p>\n<p>| character_set_server | utf8 |<\/p>\n<p>| character_set_system | utf8 |<\/p>\n<p>| character_sets_dir | \/usr\/local\/mysql\/share\/charsets\/ |<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/p>\n<p>8 rows in set (0.00 sec)<\/p>\n<p>\u540d\u8bcd\u89e3\u91ca\uff1a<\/p>\n<p>character_set_client\uff1a\u5ba2\u6237\u7aef\u8bf7\u6c42\u6570\u636e\u7684\u5b57\u7b26\u96c6<br \/>\ncharacter_set_connection\uff1a\u5ba2\u6237\u673a\/\u670d\u52a1\u5668\u8fde\u63a5\u7684\u5b57\u7b26\u96c6<br \/>\ncharacter_set_database\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u7684\u5b57\u7b26\u96c6\uff0c\u65e0\u8bba\u9ed8\u8ba4\u6570\u636e\u5e93\u5982\u4f55\u6539\u53d8\uff0c\u90fd\u662f\u8fd9\u4e2a\u5b57\u7b26\u96c6\uff1b\u5982\u679c\u6ca1\u6709\u9ed8\u8ba4\u6570\u636e\u5e93\uff0c\u90a3\u5c31\u4f7f\u7528 character_set_server\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\uff0c\u8fd9\u4e2a\u53d8\u91cf\u5efa\u8bae\u7531\u7cfb\u7edf\u81ea\u5df1\u7ba1\u7406\uff0c\u4e0d\u8981\u4eba\u4e3a\u5b9a\u4e49\u3002<br \/>\ncharacter_set_filesystem\uff1a\u628aos\u4e0a\u6587\u4ef6\u540d\u8f6c\u5316\u6210\u6b64\u5b57\u7b26\u96c6\uff0c\u5373\u628a character_set_client\u8f6c\u6362character_set_filesystem\uff0c \u9ed8\u8ba4binary\u662f\u4e0d\u505a\u4efb\u4f55\u8f6c\u6362\u7684<\/p>\n<p>character_set_results\uff1a\u7ed3\u679c\u96c6\uff0c\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u7684\u5b57\u7b26\u96c6<br \/>\ncharacter_set_server\uff1a\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u9ed8\u8ba4\u5b57\u7b26\u96c6<br \/>\ncharacter_set_system\uff1a\u7cfb\u7edf\u5b57\u7b26\u96c6\uff0c\u8fd9\u4e2a\u503c\u603b\u662futf8\uff0c\u4e0d\u9700\u8981\u8bbe\u7f6e\u3002\u8fd9\u4e2a\u5b57\u7b26\u96c6\u7528\u4e8e\u6570\u636e\u5e93\u5bf9\u8c61\uff08\u5982\u8868\u548c\u5217\uff09\u7684\u540d\u5b57\uff0c\u4e5f\u7528\u4e8e\u5b58\u50a8\u5728\u76ee\u5f55\u8868\u4e2d\u7684\u51fd\u6570\u7684\u540d\u5b57\u3002<\/p>\n<h4>4\u3001\u67e5\u770b\u5f53\u524d\u6570\u636e\u5e93\u7684\u6821\u5bf9\u89c4\u5219<\/h4>\n<p>mysql&gt; show variables like &#8216;collation%&#8217;;<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/p>\n<p>| Variable_name | Value |<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/p>\n<p>| collation_connection | utf8_general_ci |<\/p>\n<p>| collation_database | latin1_swedish_ci |<\/p>\n<p>| collation_server | utf8_general_ci |<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/p>\n<p>3 rows in set (0.01 sec)<\/p>\n<p>\u540d\u8bcd\u89e3\u91ca\uff1a<\/p>\n<p>collation_connection \u5f53\u524d\u8fde\u63a5\u7684\u5b57\u7b26\u96c6\u3002<br \/>\ncollation_database\u00a0\u00a0\u00a0 \u5f53\u524d\u65e5\u671f\u7684\u9ed8\u8ba4\u6821\u5bf9\u3002\u6bcf\u6b21\u7528USE\u8bed\u53e5\u6765\u201c\u8df3\u8f6c\u201d\u5230\u53e6\u4e00\u4e2a\u6570\u636e\u5e93\u7684\u65f6\u5019\uff0c\u8fd9\u4e2a\u53d8\u91cf\u7684\u503c\u5c31\u4f1a\u6539\u53d8\u3002\u5982\u679c\u6ca1\u6709\u5f53\u524d\u6570\u636e\u5e93\uff0c\u8fd9\u4e2a\u53d8\u91cf\u7684\u503c\u5c31\u662fcollation_server\u53d8\u91cf\u7684\u503c\u3002<br \/>\ncollation_server \u670d\u52a1\u5668\u7684\u9ed8\u8ba4\u6821\u5bf9\u3002<\/p>\n<p>\u6392\u5e8f\u65b9\u5f0f\u7684\u547d\u540d\u89c4\u5219\u4e3a\uff1a\u5b57\u7b26\u96c6\u540d\u5b57_\u8bed\u8a00_\u540e\u7f00\uff0c\u5176\u4e2d\u5404\u4e2a\u5178\u578b\u540e\u7f00\u7684\u542b\u4e49\u5982\u4e0b\uff1a<br \/>\n1\uff09_ci\uff1a\u4e0d\u533a\u5206\u5927\u5c0f\u5199\u7684\u6392\u5e8f\u65b9\u5f0f<br \/>\n2\uff09_cs\uff1a\u533a\u5206\u5927\u5c0f\u5199\u7684\u6392\u5e8f\u65b9\u5f0f<br \/>\n3\uff09_bin\uff1a\u4e8c\u8fdb\u5236\u6392\u5e8f\u65b9\u5f0f\uff0c\u5927\u5c0f\u6bd4\u8f83\u5c06\u6839\u636e\u5b57\u7b26\u7f16\u7801\uff0c\u4e0d\u6d89\u53ca\u4eba\u7c7b\u8bed\u8a00\uff0c\u56e0\u6b64_bin\u7684\u6392\u5e8f\u65b9\u5f0f\u4e0d\u5305\u542b\u4eba\u7c7b\u8bed\u8a00<\/p>\n<h3>\u4e09\u3001MySQL\u5b57\u7b26\u96c6\u7684\u8bbe\u7f6e<\/h3>\n<h4>1\u3001\u6982\u8ff0<\/h4>\n<p>MySQL\u5b57\u7b26\u96c6\u8bbe\u7f6e\u5206\u4e3a\u4e24\u7c7b\uff1a<\/p>\n<p>1\uff09\u521b\u5efa\u5bf9\u8c61\u7684\u9ed8\u8ba4\u503c\u3002<\/p>\n<p>2\uff09\u63a7\u5236server\u548cclient\u7aef\u4ea4\u4e92\u901a\u4fe1\u7684\u914d\u7f6e\u3002<\/p>\n<h5>1\u3001\u521b\u5efa\u5bf9\u8c61\u7684\u9ed8\u8ba4\u503c<\/h5>\n<p>\u5b57\u7b26\u96c6\u5408\u6821\u5bf9\u89c4\u5219\u67094\u4e2a\u7ea7\u522b\u7684\u9ed8\u8ba4\u8bbe\u7f6e\uff1a<\/p>\n<p>1\uff09\u670d\u52a1\u5668\u7ea7\u522b\uff1b<\/p>\n<p>2\uff09\u6570\u636e\u5e93\u7ea7\u522b\uff1b<\/p>\n<p>3\uff09\u8868\u7ea7\u522b\u3001\u5217\u7ea7\u522b\uff1b<\/p>\n<p>4\uff09\u8fde\u63a5\u7ea7\u522b\u3002<\/p>\n<p>\u66f4\u4f4e\u7ea7\u522b\u7684\u8bbe\u7f6e\u4f1a\u96c6\u6210\u9ad8\u7ea7\u522b\u7684\u8bbe\u7f6e\u3002<\/p>\n<p>\u8fd9\u91cc\u6709\u4e00\u4e2a\u901a\u7528\u7684\u89c4\u5219\uff1a\u5148\u4e3a\u670d\u52a1\u5668\u6216\u8005\u6570\u636e\u5e93\u9009\u62e9\u4e00\u4e2a\u5408\u7406\u7684\u5b57\u7b26\u96c6\uff0c\u7136\u540e\u6839\u636e\u4e0d\u540c\u7684\u5b9e\u9645\u60c5\u51b5\uff0c\u8ba9\u67d0\u4e2a\u5217\u9009\u62e9\u81ea\u5df1\u7684\u5b57\u7b26\u96c6\u3002<\/p>\n<h5>2\u3001\u63a7\u5236server\u548cclient\u7aef\u4ea4\u4e92\u901a\u4fe1\u7684\u914d\u7f6e<\/h5>\n<p>\u5927\u90e8\u5206MySQL\u5ba2\u6237\u7aef\u90fd\u4e0d\u5177\u5907\u540c\u65f6\u652f\u6301\u591a\u79cd\u5b57\u7b26\u96c6\u7684\u80fd\u529b\uff0c\u6bcf\u6b21\u90fd\u53ea\u80fd\u4f7f\u7528\u4e00\u79cd\u5b57\u7b26\u96c6\u3002<\/p>\n<p>\u5ba2\u6237\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u5b57\u7b26\u96c6\u8f6c\u6362\u5de5\u4f5c\u662f\u7531\u5982\u4e0b\u51e0\u4e2aMySQL\u7cfb\u7edf\u53d8\u91cf\u63a7\u5236\u7684\u3002<\/p>\n<p>1\uff09character_set_server\uff1amysql server\u9ed8\u8ba4\u5b57\u7b26\u96c6\u3002<\/p>\n<p>2\uff09character_set_database\uff1a\u6570\u636e\u5e93\u9ed8\u8ba4\u5b57\u7b26\u96c6\u3002<\/p>\n<p>3\uff09character_set_client\uff1aMySQL server\u5047\u5b9a\u5ba2\u6237\u7aef\u53d1\u9001\u7684\u67e5\u8be2\u4f7f\u7528\u7684\u5b57\u7b26\u96c6\u3002<\/p>\n<p>4\uff09character_set_connection\uff1aMySQL Server\u63a5\u6536\u5ba2\u6237\u7aef\u53d1\u5e03\u7684\u67e5\u8be2\u8bf7\u6c42\u540e\uff0c\u5c06\u5176\u8f6c\u6362\u4e3acharacter_set_connection\u53d8\u91cf\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u3002<\/p>\n<p>5\uff09character_set_results\uff1amysql server\u628a\u7ed3\u679c\u96c6\u548c\u9519\u8bef\u4fe1\u606f\u8f6c\u6362\u4e3acharacter_set_results\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\uff0c\u5e76\u53d1\u9001\u7ed9\u5ba2\u6237\u7aef\u3002<\/p>\n<p>6\uff09<strong>character_set_system<\/strong>\uff1a\u7cfb\u7edf\u5143\u6570\u636e(\u5b57\u6bb5\u540d\u7b49)\u5b57\u7b26\u96c6<\/p>\n<p>\u8fd8\u6709\u4ee5<strong>collation_<\/strong>\u5f00\u5934\u7684\u540c\u4e0a\u9762\u5bf9\u5e94\u7684\u53d8\u91cf\uff0c\u7528\u6765\u63cf\u8ff0\u5b57\u7b26\u5e8f\u3002<\/p>\n<p>\u6ce8\u610f\u4e8b\u9879\uff1a<\/p>\n<p>\u2022 my.cnf\u4e2d\u7684default_character_set\u8bbe\u7f6e\u53ea\u5f71\u54cdmysql\u547d\u4ee4\u8fde\u63a5\u670d\u52a1\u5668\u65f6\u7684\u8fde\u63a5\u5b57\u7b26\u96c6\uff0c\u4e0d\u4f1a\u5bf9\u4f7f\u7528libmysqlclient\u5e93\u7684\u5e94\u7528\u7a0b\u5e8f\u4ea7\u751f\u4efb\u4f55\u4f5c\u7528\uff01<\/p>\n<p>\u2022 \u5bf9\u5b57\u6bb5\u8fdb\u884c\u7684SQL\u51fd\u6570\u64cd\u4f5c\u901a\u5e38\u90fd\u662f\u4ee5\u5185\u90e8\u64cd\u4f5c\u5b57\u7b26\u96c6\u8fdb\u884c\u7684\uff0c\u4e0d\u53d7\u8fde\u63a5\u5b57\u7b26\u96c6\u8bbe\u7f6e\u7684\u5f71\u54cd\u3002<\/p>\n<p>\u2022 SQL\u8bed\u53e5\u4e2d\u7684\u88f8\u5b57\u7b26\u4e32\u4f1a\u53d7\u5230\u8fde\u63a5\u5b57\u7b26\u96c6\u6216introducer\u8bbe\u7f6e\u7684\u5f71\u54cd\uff0c\u5bf9\u4e8e\u6bd4\u8f83\u4e4b\u7c7b\u7684\u64cd\u4f5c\u53ef\u80fd\u4ea7\u751f\u5b8c\u5168\u4e0d\u540c\u7684\u7ed3\u679c\uff0c\u9700\u8981\u5c0f\u5fc3\uff01<\/p>\n<h4>3\u3001\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5b57\u7b26\u96c6\u9009\u62e9\u89c4\u5219<\/h4>\n<p>(1)\u7f16\u8bd1MySQL \u65f6\uff0c\u6307\u5b9a\u4e86\u4e00\u4e2a\u9ed8\u8ba4\u7684\u5b57\u7b26\u96c6\uff0c\u8fd9\u4e2a\u5b57\u7b26\u96c6\u662f latin1;<br \/>\n(2)\u5b89\u88c5MySQL \u65f6\uff0c\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6 (my.cnf) \u4e2d\u6307\u5b9a\u4e00\u4e2a\u9ed8\u8ba4\u7684\u7684\u5b57\u7b26\u96c6\uff0c\u5982\u679c\u6ca1\u6307\u5b9a\uff0c\u8fd9\u4e2a\u503c\u7ee7\u627f\u81ea\u7f16\u8bd1\u65f6\u6307\u5b9a\u7684;<br \/>\n(3)\u542f\u52a8mysqld \u65f6\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u53c2\u6570\u4e2d\u6307\u5b9a\u4e00\u4e2a\u9ed8\u8ba4\u7684\u7684\u5b57\u7b26\u96c6\uff0c\u5982\u679c\u6ca1\u6307\u5b9a\uff0c\u8fd9\u4e2a\u503c\u7ee7\u627f\u81ea\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u914d\u7f6e,\u6b64\u65f6character_set_server\u88ab\u8bbe\u5b9a\u4e3a\u8fd9\u4e2a\u9ed8\u8ba4\u7684\u5b57\u7b26\u96c6;<br \/>\n(4)\u5f53\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5e93\u65f6\uff0c\u9664\u975e\u660e\u786e\u6307\u5b9a\uff0c\u8fd9\u4e2a\u6570\u636e\u5e93\u7684\u5b57\u7b26\u96c6\u88ab\u7f3a\u7701\u8bbe\u5b9a\u4e3acharacter_set_server;<br \/>\n(5)\u5f53\u9009\u5b9a\u4e86\u4e00\u4e2a\u6570\u636e\u5e93\u65f6\uff0ccharacter_set_database\u88ab\u8bbe\u5b9a\u4e3a\u8fd9\u4e2a\u6570\u636e\u5e93\u9ed8\u8ba4\u7684\u5b57\u7b26\u96c6;<br \/>\n(6)\u5728\u8fd9\u4e2a\u6570\u636e\u5e93\u91cc\u521b\u5efa\u4e00\u5f20\u8868\u65f6\uff0c\u8868\u9ed8\u8ba4\u7684\u5b57\u7b26\u96c6\u88ab\u8bbe\u5b9a\u4e3acharacter_set_database\uff0c\u4e5f\u5c31\u662f\u8fd9\u4e2a\u6570\u636e\u5e93\u9ed8\u8ba4\u7684\u5b57\u7b26\u96c6;<br \/>\n(7)\u5f53\u5728\u8868\u5185\u8bbe\u7f6e\u4e00\u680f\u65f6\uff0c\u9664\u975e\u660e\u786e\u6307\u5b9a\uff0c\u5426\u5219\u6b64\u680f\u7f3a\u7701\u7684\u5b57\u7b26\u96c6\u5c31\u662f\u8868\u9ed8\u8ba4\u7684\u5b57\u7b26\u96c6;<\/p>\n<h4>2\u3001\u5206\u8ff0<\/h4>\n<h5>2.1\u3001\u4e3a\u5217\u5206\u914d\u5b57\u7b26\u96c6<\/h5>\n<p>\u5c5e\u4e8e\u540c\u4e00\u4e2a\u8868\u7684\u4e0d\u540c\u5217\u53ef\u4ee5\u6709\u4e0d\u540c\u7684\u5b57\u7b26\u96c6\uff0c\u5982\u679c\u6ca1\u6709\u4e3a\u4e00\u4e2a\u5217\u663e\u793a\u7684\u5b9a\u4e49\u5b57\u7b26\u96c6\u5c31\u4f7f\u7528\u9ed8\u8ba4\u5b57\u7b26\u96c6\u3002\u521b\u5efa\u4e00\u4e2a\u8868\u7684\u65f6\u5019\uff0c\u82e5\u663e\u793a\u7684\u4e3a\u5217\u6307\u5b9a\u5b57\u7b26\u96c6\uff0c\u5219\u5b57\u7b26\u96c6\u4f5c\u4e3a\u6570\u636e\u7c7b\u578b\u9009\u9879\u5305\u542b\u5728\u5176\u4e2d\uff0c\u8981\u653e\u5728\u6570\u636e\u7c7b\u578b\u540e\u9762\u53ca\u7a7a\u6307\u5b9a\u548c\u4e3b\u952e\u524d\u9762\u3002<\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<p>create table column_charset(<\/p>\n<p>c1 char(10) character set utf8 not null,<\/p>\n<p>c2 char(10) char set utf8,<\/p>\n<p>c3 varchar(10) charset utf8,<\/p>\n<p>c4 varchar(10)) engine=innodb;<\/p>\n<p><strong><em>\u6ce8\u610f\uff1a<\/em><\/strong><strong><em>character set<\/em><\/strong><strong><em>\u53ef\u4ee5\u7b80\u5199\u4e3a<\/em><\/strong><strong><em>char set<\/em><\/strong><strong><em>\u548c<\/em><\/strong><strong><em>charset<\/em><\/strong><\/p>\n<p>\u4f7f\u7528show create table table_name;\u547d\u4ee4\u67e5\u770bcolumn_charset\u5efa\u8868\u8bed\u53e5\uff1a<\/p>\n<p>mysql&gt; show create table column_charset\\G;<\/p>\n<p>*************************** 1. row ***************************<\/p>\n<p>Table: column_charset<\/p>\n<p>Create Table: CREATE TABLE `column_charset` (<\/p>\n<p>`c1` char(10) CHARACTER SET utf8 NOT NULL,<\/p>\n<p>`c2` char(10) CHARACTER SET utf8 DEFAULT NULL,<\/p>\n<p>`c3` varchar(10) CHARACTER SET utf8 DEFAULT NULL,<\/p>\n<p>`c4` varchar(10) DEFAULT NULL<\/p>\n<p>) ENGINE=InnoDB DEFAULT CHARSET=latin1<\/p>\n<p>1 row in set (0.01 sec)<\/p>\n<p>ERROR:<\/p>\n<p>No query specified<\/p>\n<p>\u63d2\u5165\u6570\u636e\uff0c\u611f\u53d7\u4e00\u4e0b\u6548\u679c\uff1a<\/p>\n<p>mysql&gt; insert into column_charset(c1,c2,c3,c4) value(&#8220;\u56fe\u7075&#8221;,&#8221;\u56fe\u7075&#8221;,&#8221;\u56fe\u7075&#8221;,&#8221;chavin&#8221;);<\/p>\n<p>Query OK, 1 row affected (0.01 sec)<\/p>\n<p>mysql&gt; select * from column_charset;<\/p>\n<p>+&#8212;&#8212;&#8211;+&#8212;&#8212;&#8211;+&#8212;&#8212;&#8211;+&#8212;&#8212;&#8211;+<\/p>\n<p>| c1 | c2 | c3 | c4 |<\/p>\n<p>+&#8212;&#8212;&#8211;+&#8212;&#8212;&#8211;+&#8212;&#8212;&#8211;+&#8212;&#8212;&#8211;+<\/p>\n<p>| \u56fe\u7075 | \u56fe\u7075 | \u56fe\u7075 | chavin |<\/p>\n<p>+&#8212;&#8212;&#8211;+&#8212;&#8212;&#8211;+&#8212;&#8212;&#8211;+&#8212;&#8212;&#8211;+<\/p>\n<p>1 row in set (0.00 sec)<\/p>\n<h5>2.2\u3001\u4e3a\u8868\u5206\u914d\u5b57\u7b26\u96c6<\/h5>\n<p>create table table_charset(<\/p>\n<p>c1 varchar(10),<\/p>\n<p>c2 varchar(10))engine=innodb default charset=utf8;<\/p>\n<p><strong><em>\u6ce8\u610f\uff1a\u4e3a\u8868\u6307\u5b9a\u5b57\u7b26\u96c6\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u51e0\u79cd\u65b9\u5f0f\uff1a<\/em><\/strong><\/p>\n<p><strong><em>default charset=utf8;<\/em><\/strong><\/p>\n<p><strong><em>charset=utf8;<\/em><\/strong><\/p>\n<p><strong><em>default character set=utf8;<\/em><\/strong><\/p>\n<p><strong><em>character set=utf8;<\/em><\/strong><\/p>\n<p><strong><em>default char set=utf8;<\/em><\/strong><\/p>\n<p><strong><em>char set=utf8;<\/em><\/strong><\/p>\n<p>\u68c0\u67e5\u5efa\u8868\u8bed\u53e5\uff1a<\/p>\n<p>mysql&gt; show create table table_charset\\G;<\/p>\n<p>*************************** 1. row ***************************<\/p>\n<p>Table: table_charset<\/p>\n<p>Create Table: CREATE TABLE `table_charset` (<\/p>\n<p>`c1` varchar(10) DEFAULT NULL,<\/p>\n<p>`c2` varchar(10) DEFAULT NULL<\/p>\n<p>) ENGINE=InnoDB DEFAULT CHARSET=utf8<\/p>\n<p>1 row in set (0.00 sec)<\/p>\n<p>\u6d4b\u8bd5\uff1a<\/p>\n<p>mysql&gt; insert into table_charset(c1,c2) values(&#8216;\u56fe\u7075&#8217;,&#8217;\u56fe\u7075&#8217;);<\/p>\n<p>Query OK, 1 row affected (0.01 sec)<\/p>\n<p>mysql&gt; select * from table_charset;<\/p>\n<p>+&#8212;&#8212;&#8211;+&#8212;&#8212;&#8211;+<\/p>\n<p>| c1 | c2 |<\/p>\n<p>+&#8212;&#8212;&#8211;+&#8212;&#8212;&#8211;+<\/p>\n<p>| \u56fe\u7075 | \u56fe\u7075 |<\/p>\n<p>+&#8212;&#8212;&#8211;+&#8212;&#8212;&#8211;+<\/p>\n<p>1 row in set (0.00 sec)<\/p>\n<h5>2.3\u3001\u4e3a\u6570\u636e\u5e93\u6307\u5b9a\u5b57\u7b26\u96c6<\/h5>\n<p>\u521b\u5efa\u7684\u6bcf\u4e2a\u6570\u636e\u5e93\u90fd\u6709\u4e00\u4e2a\u9ed8\u8ba4\u5b57\u7b26\u96c6\uff0c\u5982\u679c\u6ca1\u6709\u6307\u5b9a\uff0c\u5c31\u7528latin1\u3002<\/p>\n<p>create database dbking charset=utf8;<\/p>\n<p><strong><em>\u6ce8\u610f\uff1a\u521b\u5efa\u6570\u636e\u5e93\u5206\u914d\u5b57\u7b26\u96c6\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u51e0\u79cd\u5b50\u53e5\uff1a<\/em><\/strong><\/p>\n<p><strong><em>charset=utf8;<\/em><\/strong><\/p>\n<p><strong><em>default charset=utf8;<\/em><\/strong><\/p>\n<p><strong><em>charset utf8;<\/em><\/strong><\/p>\n<p><strong><em>default charset utf8;<\/em><\/strong><\/p>\n<p><strong><em>char set=utf8;<\/em><\/strong><\/p>\n<p><strong><em>default char set=utf8;<\/em><\/strong><\/p>\n<p><strong><em>char set utf8;<\/em><\/strong><\/p>\n<p><strong><em>default char set utf8;<\/em><\/strong><\/p>\n<p><strong><em>character set=utf8;<\/em><\/strong><\/p>\n<p><strong><em>default character set=utf8;<\/em><\/strong><\/p>\n<p><strong><em>character set utf8;<\/em><\/strong><\/p>\n<p><strong><em>default character set utf8;<\/em><\/strong><\/p>\n<p>\u4f7f\u7528show create database db_name;\u547d\u4ee4\u67e5\u770b\u6570\u636e\u5e93\u521b\u5efa\u8bed\u53e5\uff1a<\/p>\n<p>mysql&gt; show create database dbking;<\/p>\n<p>+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<\/p>\n<p>| Database | Create Database |<\/p>\n<p>+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<\/p>\n<p>| dbking | CREATE DATABASE `dbking` \/*!40100 DEFAULT CHARACTER SET utf8 *\/ |<\/p>\n<p>+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<\/p>\n<p>1 row in set (0.00 sec)<\/p>\n<h5>2.4\u3001\u4e3a\u5217\u5206\u914d\u6821\u5bf9\u89c4\u5219<\/h5>\n<p>\u6bcf\u4e2a\u5217\u90fd\u5e94\u8be5\u6709\u4e00\u4e2a\u6821\u5bf9\uff0c\u5982\u679c\u6ca1\u6709\u663e\u793a\u6307\u5b9a\uff0cMySQL\u5c31\u4f7f\u7528\u5c5e\u4e8e\u8be5\u5b57\u7b26\u96c6\u7684\u9ed8\u8ba4\u6821\u5bf9\u3002\u5982\u679c\u6307\u5b9a\u4e86\u4e00\u4e2a\u5b57\u7b26\u96c6\u548c\u4e00\u4e2a\u6821\u5bf9\uff0c\u5b57\u7b26\u96c6\u5e94\u8be5\u653e\u5728\u524d\u9762\u3002<\/p>\n<p>create table column_collate(<\/p>\n<p>c1 varchar(10) charset utf8 collate utf8_romanian_ci not null,<\/p>\n<p>c2 varchar(10) charset utf8 collate\u00a0<a name=\"OLE_LINK4\"><\/a><a name=\"OLE_LINK3\"><\/a>utf8_spanish_ci)engine=innodb;<\/p>\n<p>\u67e5\u770b\u8868\u7684\u6821\u9a8c\u89c4\u5219\u4fe1\u606f\uff1a<\/p>\n<p>mysql&gt; select table_name,column_name,collation_name<\/p>\n<p>from information_schema.columns<\/p>\n<p>where table_name=&#8217;column_collate&#8217;;<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<\/p>\n<p>| table_name | column_name | collation_name |<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<\/p>\n<p>| column_collate | c1 | utf8_romanian_ci |<\/p>\n<p>| column_collate | c2 | utf8_spanish_ci |<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<\/p>\n<p>2 rows in set (0.04 sec)<\/p>\n<p>\u6ce8\u610f\uff1a\u5b57\u7b26\u96c6\u548c\u6821\u5bf9\u5728\u5904\u7406\u5b57\u7b26\u8868\u8fbe\u5f0f\u7684\u8fc7\u7a0b\u4e2d\u626e\u6f14\u7740\u91cd\u8981\u89d2\u8272\u3002\u6211\u4eec\u4e0d\u80fd\u6bd4\u8f83\u4e24\u4e2a\u5c5e\u4e8e\u4e0d\u540c\u6821\u5bf9\u7684\u4e0d\u540c\u5b57\u7b26\u503c\u3002\u4f8b\u5982\uff1a<\/p>\n<p>mysql&gt; insert into column_collate(c1,c2) values(&#8216;A&#8217;,&#8217;A&#8217;);<\/p>\n<p>Query OK, 1 row affected (0.22 sec)<\/p>\n<p>mysql&gt; select * from column_collate;<\/p>\n<p>+&#8212;-+&#8212;&#8212;+<\/p>\n<p>| c1 | c2 |<\/p>\n<p>+&#8212;-+&#8212;&#8212;+<\/p>\n<p>| A | A |<\/p>\n<p>+&#8212;-+&#8212;&#8212;+<\/p>\n<p>1 row in set (0.00 sec)<\/p>\n<p>mysql&gt; select * from column_collate where c1=c2;<\/p>\n<p>ERROR 1267 (HY000): Illegal mix of collations (utf8_romanian_ci,IMPLICIT) and (utf8_spanish_ci,IMPLICIT) for operation &#8216;=&#8217;<\/p>\n<h5>2.5\u3001\u4e3a\u8868\u6307\u5b9a\u6821\u5bf9\u89c4\u5219<\/h5>\n<p>create table table_collate(<\/p>\n<p>c1 varchar(10),<\/p>\n<p>c2 varchar(10))engine=innodb default charset utf8 collate utf8_romanian_ci;<\/p>\n<p>\u68c0\u67e5\u8868\u7684\u6821\u5bf9\u89c4\u5219\uff1a<\/p>\n<p>mysql&gt; select table_name,column_name,collation_name from information_schema.columns where table_name=&#8217;table_collate&#8217;;<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<\/p>\n<p>| table_name | column_name | collation_name |<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<\/p>\n<p>| table_collate | c1 | utf8_romanian_ci |<\/p>\n<p>| table_collate | c2 | utf8_romanian_ci |<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<\/p>\n<p>2 rows in set (0.00 sec)<\/p>\n<h5>2.6\u3001\u4e3a\u6570\u636e\u5e93\u6307\u5b9a\u6821\u5bf9\u89c4\u5219<\/h5>\n<p>create database dbking102 default charset utf8 collate utf8_romanian_ci;<\/p>\n<p>\u67e5\u770b\u6570\u636e\u5e93\u5b9a\u4e49\u8bed\u53e5\uff1a<\/p>\n<p>mysql&gt; show create database dbking102\\G;<\/p>\n<p>*************************** 1. row ***************************<\/p>\n<p>Database: dbking102<\/p>\n<p>Create Database: CREATE DATABASE `dbking102` \/*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_romanian_ci *\/<\/p>\n<p>1 row in set (0.00 sec)<\/p>\n<h5>2.7\u3001\u5b57\u7b26\u76f4\u63a5\u91cf\u5b57\u7b26\u96c6<\/h5>\n<p>\u5982\u679c\u6ca1\u6709\u663e\u793a\u6307\u5b9a\uff0c\u90a3\u4e48\u5b57\u7b26\u76f4\u63a5\u91cf\u7684\u5b57\u7b26\u96c6\u5c31\u662f\u6570\u636e\u5e93\u7684\u9ed8\u8ba4\u5b57\u7b26\u96c6\u3002\u5982\u679c\u8981\u663e\u793a\u5206\u914d\u53e6\u4e00\u4e2a\u5b57\u7b26\u96c6\uff0c\u9700\u8981\u628a\u5b57\u7b26\u96c6\u7684\u540d\u5b57\u653e\u5728\u76f4\u63a5\u91cf\u524d\u9762\uff0c\u5e76\u4e14\u8981\u5728\u5b57\u7b26\u96c6\u524d\u9762\u52a0\u4e0a\u4e0b\u5212\u7ebf\u3002<\/p>\n<pre>mysql&gt; select _utf8'\u8bed\u8a00 Language \u8a00\u8a9e \u044f\u0437\u044b\u043a';<\/pre>\n<pre>+---------------------------------+<\/pre>\n<pre>| \u8bed\u8a00 Language \u8a00\u8a9e \u044f\u0437\u044b\u043a\u00a0\u00a0\u00a0\u00a0 |<\/pre>\n<pre>+---------------------------------+<\/pre>\n<pre>| \u8bed\u8a00 Language \u8a00\u8a9e \u044f\u0437\u044b\u043a\u00a0\u00a0\u00a0\u00a0 |<\/pre>\n<pre>+---------------------------------+<\/pre>\n<h5>2.8\u3001\u4fee\u6539\u548c\u8bbe\u7f6eMySQL\u670d\u52a1\u5668\u7ea7\u522b\u5b57\u7b26\u96c6<\/h5>\n<p>MySQL\u670d\u52a1\u5668\u652f\u6301\u4f17\u591a\u4e0d\u540c\u7684\u5b57\u7b26\u96c6\uff0c\u8fd9\u7c7b\u5b57\u7b26\u96c6\u53ef\u5728\u7f16\u8bd1\u65f6\u548c\u8fd0\u884c\u65f6\u6307\u5b9a\u3002<\/p>\n<h6>\u00a0\u00a0\u00a0 1\uff09 \u7f16\u8bd1\u65f6\u6307\u5b9a<\/h6>\n<p>\u7f16\u8bd1\u65f6\u53ef\u6307\u5b9a\u9ed8\u8ba4\u5b57\u7b26\u96c6\u548c\u9ed8\u8ba4\u6821\u5bf9\u89c4\u5219\uff0c\u8981\u60f3\u540c\u65f6\u66f4\u6539\u9ed8\u8ba4\u5b57\u7b26\u96c6\u548c\u6821\u5bf9\u89c4\u5219\uff0c\u8981\u540c\u65f6\u4f7f\u7528&#8211;with-charset\u548c&#8211;with-collation\u9009\u9879\u3002\u6821\u5bf9\u89c4\u5219\u5fc5\u987b\u662f\u5b57\u7b26\u96c6\u7684\u5408\u6cd5\u6821\u5bf9\u89c4\u5219\u3002<\/p>\n<p>.\/configure &#8212; with-charset=CHARSET &#8211;with-collation=COLLATION<\/p>\n<p>\u901a\u8fc7configure\u9009\u9879&#8211;with-extra-charsets=LIST\uff0c\u53ef\u4ee5\u5b9a\u4e49\u5728\u670d\u52a1\u5668\u4e2d\u518d\u5b9a\u4e49\u589e\u52a0\u5b57\u7b26\u96c6\u3002LIST \u6307\u4e0b\u9762\u4efb\u4f55\u4e00\u9879\uff1a<br \/>\na.\u7a7a\u683c\u95f4\u9694\u7684\u4e00\u7cfb\u5217\u5b57\u7b26\u96c6\u540d<br \/>\nb.complex -\uff0c\u4ee5\u5305\u62ec\u4e0d\u80fd\u52a8\u6001\u88c5\u8f7d\u7684\u6240\u6709\u5b57\u7b26\u96c6<br \/>\nc.all \u2013\uff0c\u4ee5\u5c06\u6240\u6709\u5b57\u7b26\u96c6\u5305\u62ec\u8fdb\u4e8c\u8fdb\u5236<\/p>\n<p>.\/configure &#8212; with-charset=CHARSET &#8211;with-collation=COLLATION &#8211;with-extra-charsets=all<\/p>\n<h6>\u00a0\u00a0\u00a0 2\uff09 \u5728\u53c2\u6570\u6587\u4ef6my.cnf\u4e2d\u6307\u5b9a<\/h6>\n<p>[mysqld]<\/p>\n<p>character_set_server=utf8<\/p>\n<p>&#8211;\u5f71\u54cd\u53c2\u6570\uff1acharacter_set_server \u548c character_set_database<\/p>\n<p>&#8211;\u6ce8\u610f\uff1a\u4fee\u6539\u540e\u8981\u91cd\u542f\u6570\u636e\u5e93\u624d\u80fd\u751f\u6548\u3002<\/p>\n<p>[client]<\/p>\n<p>default-character-set=utf8<\/p>\n<p>&#8211;\u5f71\u54cd\u53c2\u6570\uff1acharacter_set_client\uff0ccharacter_set_connection \u548ccharacter_set_results\u3002<\/p>\n<p>&#8211;\u6ce8\u610f\uff1a\u4fee\u6539\u540e\u65e0\u9700\u91cd\u542f\u6570\u636e\u5e93\u3002<br \/>\n3\uff09 \u5728\u542f\u52a8\u53c2\u6570\u524d\u6307\u5b9a<\/p>\n<p>.\/mysqld &#8211;character-set-server=utf8 &amp;<\/p>\n<p>&#8211;\u5f71\u54cd\u53c2\u6570\uff1acharacter_set_server \u548c character_set_database<br \/>\n4\uff09\u5728mysql\u5ba2\u6237\u7aef\u767b\u9646\u65f6\u901a\u8fc7&#8211;default-character-set\u6307\u5b9a<\/p>\n<p>mysql -uroot -pmysql\u00a0<a name=\"OLE_LINK6\"><\/a><a name=\"OLE_LINK5\"><\/a>&#8211;default-character-set=utf8<\/p>\n<p>&#8211;\u5f71\u54cd\u53c2\u6570\uff1aset character_set_client\uff0cset character_set_connection\uff0cset character_set_results\u3002<\/p>\n<h6>\u00a0\u00a0\u00a0 5\uff09\u4e34\u65f6\u6307\u5b9a<\/h6>\n<p>a\uff09\u5206\u522b\u6307\u5b9a<\/p>\n<p>mysql&gt; SET character_set_client = utf8;<\/p>\n<p>mysql&gt; SET character_set_connection = utf8;<\/p>\n<p>mysql&gt; SET character_set_database = utf8;<\/p>\n<p>mysql&gt; SET character_set_results = utf8;<\/p>\n<p>mysql&gt; SET character_set_server = utf8;<\/p>\n<p>b\uff09mysql\u5ba2\u6237\u7aef\u4f7f\u7528\uff1aset names utf8;<\/p>\n<p>\u7b49\u540c\u4e8e<\/p>\n<p><a name=\"OLE_LINK2\"><\/a><a name=\"OLE_LINK1\"><\/a>set character_set_client=utf8;<\/p>\n<p>set character_set_connection=utf8;<\/p>\n<p>set character_set_results=utf8;<\/p>\n<p>c\uff09set character set utf8;<\/p>\n<p>\u7b49\u540c\u4e8e<\/p>\n<p>set character_set_client=utf8;<\/p>\n<p>set character_set_results=utf8;<\/p>\n<p>set collation_connection=@@collation_database;<\/p>\n<h4>3\u3001\u603b\u7ed3<\/h4>\n<p>\u4e0b\u9762\u4ecb\u7ecd\u4e0b\u51e0\u4e2aMYSQL\u547d\u4ee4\uff1a<br \/>\n1\uff09show character set;\u6216show char set;<br \/>\n\u67e5\u770b\u6570\u636e\u5e93\u652f\u6301\u7684\u6240\u6709\u5b57\u7b26\u96c6<br \/>\n2\uff09status;\u6216\\s;<br \/>\n\u67e5\u770b\u5f53\u524d\u72b6\u6001 \u91cc\u9762\u5305\u62ec\u5f53\u7136\u7684\u5b57\u7b26\u96c6\u8bbe\u7f6e<br \/>\n3\uff09show variables like &#8216;char%&#8217;;<br \/>\n\u67e5\u770b\u7cfb\u7edf\u5b57\u7b26\u96c6\u8bbe\u7f6e\uff0c\u5305\u62ec\u6240\u6709\u7684\u5b57\u7b26\u96c6\u8bbe\u7f6e<br \/>\n4\uff09show table status from sqlstudy like &#8216;%countries%&#8217;;<br \/>\n\u67e5\u770bsqlstudy\u6570\u636e\u5e93\u4e2d\u8868\u7684\u5b57\u7b26\u96c6\u8bbe\u7f6e<br \/>\n5\uff09show full columns from countries;<br \/>\n\u67e5\u770b\u8868\u5217\u7684\u5b57\u7b26\u96c6\u8bbe\u7f6e\uff0c\u5173\u952e\u662f\u5728\u540c\u4e00\u4e2a\u8868\u4e2d\uff0c\u6bcf\u5217\u53ef\u4ee5\u8bbe\u7f6e\u6210\u4e0d\u540c\u7684\u5b57\u7b26\u96c6<br \/>\n\u77e5\u9053\u600e\u4e48\u67e5\u770b\u5b57\u7b26\u96c6\u4e86\uff0c\u4e0b\u9762\u6211\u6765\u8bf4\u4e0b\u5982\u4f55\u8bbe\u7f6e\u8fd9\u4e9b\u5b57\u7b26\u96c6<br \/>\n1.\u4fee\u6539\u670d\u52a1\u5668\u7ea7<br \/>\na. \u4e34\u65f6\u66f4\u6539\uff1a<br \/>\nmysql&gt;SET GLOBAL character_set_server=utf8;<br \/>\nb. \u6c38\u4e45\u66f4\u6539\uff1a<br \/>\n\u4fee\u6539my.cnf\u6587\u4ef6<br \/>\n[mysqld]<br \/>\ncharacter-set-server=utf8<br \/>\n2.\u4fee\u6539\u6570\u636e\u5e93\u7ea7<br \/>\na. \u4e34\u65f6\u66f4\u6539\uff1a<br \/>\nmysql&gt;SET GLOBAL character_set_database=utf8;<br \/>\nb. \u6c38\u4e45\u66f4\u6539\uff1a<br \/>\n\u6539\u4e86\u670d\u52a1\u5668\u7ea7\u5c31\u53ef\u4ee5\u4e86<br \/>\n3.\u4fee\u6539\u8868\u7ea7<br \/>\nmysql&gt;ALTER TABLE table_name DEFAULT CHARSET utf8;<br \/>\n\u66f4\u6539\u4e86\u540e\u6c38\u4e45\u751f\u6548<br \/>\n4.\u4fee\u6539\u5217\u7ea7<br \/>\n\u4fee\u6539\u793a\u4f8b\uff1a<br \/>\nmysql&gt;alter table `products` change `products_model` `products_model` varchar( 20 )<br \/>\ncharacter set\u00a0 utf8 collate utf8_general_ci null default null;<br \/>\n\u66f4\u6539\u4e86\u540e\u6c38\u4e45\u751f\u6548<br \/>\n5.\u66f4\u6539\u8fde\u63a5\u5b57\u7b26\u96c6<br \/>\na. \u4e34\u65f6\u66f4\u6539\uff1a<br \/>\nmysql&gt; set names utf8;<br \/>\nb. \u6c38\u4e45\u66f4\u6539\uff1a<br \/>\n\u4fee\u6539my.cnf\u6587\u4ef6<br \/>\n\u5728[client]\u4e2d\u589e\u52a0\uff1a<br \/>\ndefault-character-set=utf8<br \/>\n\u6267\u884cSQL\u8bed\u53e5\u65f6\u4fe1\u606f\u7684\u8def\u5f84\u662f\u8fd9\u6837\u7684<br \/>\n\u4fe1\u606f\u8f93\u5165\u8def\u5f84\uff1aclient\u2192connection\u2192server;<br \/>\n\u4fe1\u606f\u8f93\u51fa\u8def\u5f84\uff1aserver\u2192connection\u2192results.<\/p>\n<h3>\u56db\u3001MySQL\u6570\u636e\u5e93\u4e2d\u5b57\u7b26\u96c6\u8f6c\u6362\u6d41\u7a0b<\/h3>\n<p>1\u3001MySQL Server\u6536\u5230\u8bf7\u6c42\u65f6\u5c06\u8bf7\u6c42\u6570\u636e\u4ececharacter_set_client\u8f6c\u6362\u4e3acharacter_set_connection\uff1b<br \/>\n2\u3001\u8fdb\u884c\u5185\u90e8\u64cd\u4f5c\u524d\u5c06\u8bf7\u6c42\u6570\u636e\u4ececharacter_set_connection\u8f6c\u6362\u4e3a\u5185\u90e8\u64cd\u4f5c\u5b57\u7b26\u96c6\uff0c\u5176\u786e\u5b9a\u65b9\u6cd5\u5982\u4e0b\uff1a<br \/>\n\u4f7f\u7528\u6bcf\u4e2a\u6570\u636e\u5b57\u6bb5\u7684CHARACTER SET\u8bbe\u5b9a\u503c\uff1b<br \/>\n\u82e5\u4e0a\u8ff0\u503c\u4e0d\u5b58\u5728\uff0c\u5219\u4f7f\u7528\u5bf9\u5e94\u6570\u636e\u8868\u7684DEFAULT CHARACTER SET\u8bbe\u5b9a\u503c(MySQL\u6269\u5c55\uff0c\u975eSQL\u6807\u51c6)\uff1b<br \/>\n\u82e5\u4e0a\u8ff0\u503c\u4e0d\u5b58\u5728\uff0c\u5219\u4f7f\u7528\u5bf9\u5e94\u6570\u636e\u5e93\u7684DEFAULT CHARACTER SET\u8bbe\u5b9a\u503c\uff1b<br \/>\n\u82e5\u4e0a\u8ff0\u503c\u4e0d\u5b58\u5728\uff0c\u5219\u4f7f\u7528character_set_server\u8bbe\u5b9a\u503c\u3002<br \/>\n3\u3001\u5c06\u64cd\u4f5c\u7ed3\u679c\u4ece\u5185\u90e8\u64cd\u4f5c\u5b57\u7b26\u96c6\u8f6c\u6362\u4e3acharacter_set_results\u3002<\/p>\n<p>\u4e0b\u56fe\u6e90\u81ea\u4e8e\u300a\u9ad8\u6027\u80fdMySQL\u300b\u4e2d\u5173\u4e8e\u5b57\u7b26\u96c6\u8f6c\u6362\u7684\u56fe\u89e3\uff1a<\/p>\n<p><a href=\"http:\/\/images2015.cnblogs.com\/blog\/669905\/201705\/669905-20170529003503344-1694516152.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"clip_image002\" src=\"https:\/\/images2015.cnblogs.com\/blog\/669905\/201705\/669905-20170529003505047-1070819958.jpg\" alt=\"clip_image002\" width=\"709\" height=\"307\" border=\"0\" \/><\/a><\/p>\n<h3>\u4e94\u3001MySQL\u6570\u636e\u5e93\u4e71\u7801\u539f\u56e0\u89e3\u6790\u53ca\u6848\u4f8b<\/h3>\n<p>1\u3001\u4ea7\u751f\u4e71\u7801\u7684\u6839\u672c\u539f\u56e0<br \/>\n1\uff09\u5ba2\u6237\u673a\u6ca1\u6709\u6b63\u786e\u5730\u8bbe\u7f6eclient\u5b57\u7b26\u96c6\uff0c\u5bfc\u81f4\u539f\u5148\u7684SQL\u8bed\u53e5\u88ab\u8f6c\u6362\u6210connection\u6240\u6307\u5b57\u7b26\u96c6\uff0c\u800c\u8fd9\u79cd\u8f6c\u6362\uff0c\u662f\u4f1a\u4e22\u5931\u4fe1\u606f\u7684\uff0c\u5982\u679cclient\u662futf8\u683c\u5f0f\uff0c\u90a3\u4e48\u5982\u679c\u8f6c\u6362\u6210gb2312\u683c\u5f0f\uff0c\u8fd9\u5176\u4e2d\u5fc5\u5b9a\u4f1a\u4e22\u5931\u4fe1\u606f\uff0c\u53cd\u4e4b\u5219\u4e0d\u4f1a\u4e22\u5931\u3002\u4e00\u5b9a\u8981\u4fdd\u8bc1connection\u7684\u5b57\u7b26\u96c6\u5927\u4e8eclient\u5b57\u7b26\u96c6\u624d\u80fd\u4fdd\u8bc1\u8f6c\u6362\u4e0d\u4e22\u5931\u4fe1\u606f\u3002<br \/>\n2\uff09\u6570\u636e\u5e93\u5b57\u4f53\u6ca1\u6709\u8bbe\u7f6e\u6b63\u786e\uff0c\u5982\u679c\u6570\u636e\u5e93\u5b57\u4f53\u8bbe\u7f6e\u4e0d\u6b63\u786e\uff0c\u90a3\u4e48connection\u5b57\u7b26\u96c6\u8f6c\u6362\u6210database\u5b57\u7b26\u96c6\u7167\u6837\u4e22\u5931\u7f16\u7801\uff0c\u539f\u56e0\u8ddf\u4e0a\u9762\u4e00\u6837\u3002<\/p>\n<h4>2\u3001\u4e71\u7801\u6216\u6570\u636e\u4e22\u5931<\/h4>\n<p>character_set_client:\u6211\u4eec\u8981\u544a\u8bc9\u670d\u52a1\u5668\uff0c\u6211\u7ed9\u4f60\u53d1\u9001\u7684\u6570\u636e\u662f\u4ec0\u4e48\u7f16\u7801\uff1f<br \/>\ncharacter_set_connection:\u544a\u8bc9\u5b57\u7b26\u96c6\u8f6c\u6362\u5668\uff0c\u8f6c\u6362\u6210\u4ec0\u4e48\u7f16\u7801\uff1f<br \/>\ncharacter_set_results:\u67e5\u8be2\u7684\u7ed3\u679c\u7528\u4ec0\u4e48\u7f16\u7801\uff1f<br \/>\n\u5982\u679c\u4ee5\u4e0a\u4e09\u8005\u90fd\u4e3a\u5b57\u7b26\u96c6N,\u53ef\u7b80\u5199\u4e3aset names &#8216;N&#8217;;<\/p>\n<h5>2.1 \u4e71\u7801\u95ee\u9898<\/h5>\n<p>\u6a21\u62df\u60c5\u666f1\uff1a<\/p>\n<p>\u5411\u9ed8\u8ba4\u5b57\u7b26\u96c6\u4e3autf8\u7684\u6570\u636e\u8868\u63d2\u5165utf8\u7f16\u7801\u7684\u6570\u636e\u524d\u8fde\u63a5\u5b57\u7b26\u96c6\u8bbe\u7f6e\u4e3alatin1\uff0c\u67e5\u8be2\u65f6\u8bbe\u7f6e\u8fde\u63a5\u5b57\u7b26\u96c6\u4e3autf8\u3002<\/p>\n<p>\u63d2\u5165\u65f6\u6839\u636eMySQL\u670d\u52a1\u5668\u7684\u9ed8\u8ba4\u8bbe\u7f6e\uff0ccharacter_set_client\u3001character_set_connection\u548ccharacter_set_results\u5747\u4e3alatin1\uff1b<br \/>\n\u63d2\u5165\u64cd\u4f5c\u7684\u6570\u636e\u5c06\u7ecf\u8fc7latin1=&gt;latin1=&gt;utf8\u7684\u5b57\u7b26\u96c6\u8f6c\u6362\u8fc7\u7a0b\uff0c\u8fd9\u4e00\u8fc7\u7a0b\u4e2d\u6bcf\u4e2a\u63d2\u5165\u7684\u6c49\u5b57\u90fd\u4f1a\u4ece\u539f\u59cb\u76843\u4e2a\u5b57\u8282\u53d8\u62106\u4e2a\u5b57\u8282\u4fdd\u5b58\uff1b<br \/>\n\u67e5\u8be2\u65f6\u7684\u7ed3\u679c\u5c06\u7ecf\u8fc7utf8=&gt;utf8\u7684\u5b57\u7b26\u96c6\u8f6c\u6362\u8fc7\u7a0b\uff0c\u5c06\u4fdd\u5b58\u76846\u4e2a\u5b57\u8282\u539f\u5c01\u4e0d\u52a8\u8fd4\u56de\uff0c\u4ea7\u751f\u4e71\u7801\u2026\u2026<\/p>\n<p><strong><a href=\"http:\/\/images2015.cnblogs.com\/blog\/669905\/201705\/669905-20170529003506250-240859631.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"clip_image004\" src=\"https:\/\/images2015.cnblogs.com\/blog\/669905\/201705\/669905-20170529003507328-353636243.jpg\" alt=\"clip_image004\" width=\"820\" height=\"284\" border=\"0\" \/><\/a><\/strong><\/p>\n<p><strong>\u4f8b\u5982\uff1a<\/strong><\/p>\n<p>mysql&gt; set names latin1;<\/p>\n<p>mysql&gt; create table temp(name varchar(10)) charset utf8;<\/p>\n<p>mysql&gt; insert into temp values(&#8216;\u4e2d\u56fd&#8217;);<\/p>\n<p>mysql&gt; select * from temp;<\/p>\n<p>+&#8212;&#8212;&#8211;+<\/p>\n<p>| name |<\/p>\n<p>+&#8212;&#8212;&#8211;+<\/p>\n<p>| \u4e2d\u56fd |<\/p>\n<p>+&#8212;&#8212;&#8211;+<\/p>\n<p>mysql&gt; set names utf8;<\/p>\n<p>mysql&gt; select * from temp;<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;+<\/p>\n<p>| name |<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;+<\/p>\n<p>| \u00e4\u00b8\u00ad\u00e5\u203a\u00bd |<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;+<\/p>\n<p>\u6ce8\u610f\uff1a\u5b58\u50a8\u5b57\u7b26\u96c6\u7f16\u7801\u6bd4\u63d2\u5165\u65f6\u5b57\u7b26\u96c6\u5927\u65f6\uff0c\u5982\u679c\u539f\u5c01\u4e0d\u52a8\u8fd4\u56de\u6570\u636e\u4f1a\u51fa\u73b0\u4e71\u7801\uff0c\u4e0d\u8fc7\u53ef\u901a\u8fc7\u4fee\u6539\u67e5\u8be2\u5b57\u7b26\u96c6\uff0c\u907f\u514d\u4e71\u7801\uff0c\u5373\u4e0d\u4f1a\u4e22\u5931\u6570\u636e\u3002<\/p>\n<h5>2.2 \u6570\u636e\u4e22\u5931\u95ee\u9898<\/h5>\n<p>\u6a21\u62df\u60c5\u666f1\uff1a<\/p>\n<p>\u5411\u9ed8\u8ba4\u5b57\u7b26\u96c6\u4e3alatin1\u7684\u6570\u636e\u8868\u63d2\u5165utf8\u7f16\u7801\u7684\u6570\u636e\u524d\u8bbe\u7f6e\u4e86\u8fde\u63a5\u5b57\u7b26\u96c6\u4e3autf8<br \/>\n\u63d2\u5165\u65f6\u6839\u636e\u8fde\u63a5\u5b57\u7b26\u96c6\u8bbe\u7f6e\uff0ccharacter_set_client\u3001character_set_connection\u548ccharacter_set_results\u5747\u4e3autf8\uff1b<br \/>\n\u63d2\u5165\u6570\u636e\u5c06\u7ecf\u8fc7utf8=&gt;utf8=&gt;latin1\u7684\u5b57\u7b26\u96c6\u8f6c\u6362\uff0c\u82e5\u539f\u59cb\u6570\u636e\u4e2d\u542b\u6709\\u0000~\\u00ff\u8303\u56f4\u4ee5\u5916\u7684Unicode\u5b57 \u7b26\uff0c\u4f1a\u56e0\u4e3a\u65e0\u6cd5\u5728latin1\u5b57\u7b26\u96c6\u4e2d\u8868\u793a\u800c\u88ab\u8f6c\u6362\u4e3a\u201c?\u201d(0\u00d73F)\u7b26\u53f7\uff0c\u4ee5\u540e\u67e5\u8be2\u65f6\u4e0d\u7ba1\u8fde\u63a5\u5b57\u7b26\u96c6\u8bbe\u7f6e\u5982\u4f55\u90fd\u65e0\u6cd5\u6062\u590d\u5176\u5185\u5bb9\u4e86\u3002<\/p>\n<p><a href=\"http:\/\/images2015.cnblogs.com\/blog\/669905\/201705\/669905-20170529003508360-587956587.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"clip_image006\" src=\"https:\/\/images2015.cnblogs.com\/blog\/669905\/201705\/669905-20170529003509407-617465747.jpg\" alt=\"clip_image006\" width=\"834\" height=\"280\" border=\"0\" \/><\/a><\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<p>mysql&gt; set names utf8;<\/p>\n<p>mysql&gt; create table temp(name varchar(10)) charset latin1;<\/p>\n<p>mysql&gt; insert into temp values(&#8216;\u4e2d\u56fd&#8217;);<\/p>\n<p>mysql&gt; select * from temp;<\/p>\n<p>+&#8212;&#8212;+<\/p>\n<p>| name |<\/p>\n<p>+&#8212;&#8212;+<\/p>\n<p>| ?? |<\/p>\n<p>+&#8212;&#8212;+<\/p>\n<p>mysql&gt; set names latin1;<\/p>\n<p>mysql&gt; select * from temp;<\/p>\n<p>+&#8212;&#8212;+<\/p>\n<p>| name |<\/p>\n<p>+&#8212;&#8212;+<\/p>\n<p>| ?? |<\/p>\n<p>+&#8212;&#8212;+<\/p>\n<p>\u6570\u636e\u4e0d\u5b8c\u6574\u4e86\uff0c\u4e14\u65e0\u6cd5\u6062\u590d\u3002<\/p>\n<h4>3\u3001 \u4e71\u7801\u7ec8\u6781\u89e3\u51b3\u65b9\u6848<\/h4>\n<p>1\uff09\u9996\u5148\u8981\u660e\u786e\u4f60\u7684\u5ba2\u6237\u7aef\u65f6\u5019\u4f55\u79cd\u7f16\u7801\u683c\u5f0f\uff0c\u8fd9\u662f\u6700\u91cd\u8981\u7684\uff08IE6\u4e00\u822c\u7528utf8\uff0c\u547d\u4ee4\u884c\u4e00\u822c\u662fgbk\uff0c\u4e00\u822c\u7a0b\u5e8f\u662fgb2312)<br \/>\n2\uff09\u786e\u4fdd\u4f60\u7684\u6570\u636e\u5e93\u4f7f\u7528utf8\u683c\u5f0f\uff0c\u5f88\u7b80\u5355\uff0c\u6240\u6709\u7f16\u7801\u901a\u5403\u3002<br \/>\n3\uff09\u4e00\u5b9a\u8981\u4fdd\u8bc1connection\u5b57\u7b26\u96c6\u5927\u4e8e\u7b49\u4e8eclient\u5b57\u7b26\u96c6\uff0c\u4e0d\u7136\u5c31\u4f1a\u4fe1\u606f\u4e22\u5931\uff0c\u6bd4\u5982\uff1a latin1 &lt; gb2312 &lt; gbk &lt; utf8\uff0c\u82e5\u8bbe\u7f6eset character_set_client = gb2312\uff0c\u90a3\u4e48\u81f3\u5c11connection\u7684\u5b57\u7b26\u96c6\u8981\u5927\u4e8e\u7b49\u4e8egb2312\uff0c\u5426\u5219\u5c31\u4f1a\u4e22\u5931\u4fe1\u606f<br \/>\n4\uff09\u4ee5\u4e0a\u4e09\u6b65\u505a\u6b63\u786e\u7684\u8bdd\uff0c\u90a3\u4e48\u6240\u6709\u4e2d\u6587\u90fd\u88ab\u6b63\u786e\u5730\u8f6c\u6362\u6210utf8\u683c\u5f0f\u5b58\u50a8\u8fdb\u4e86\u6570\u636e\u5e93\uff0c\u4e3a\u4e86\u9002\u5e94\u4e0d\u540c\u7684\u6d4f\u89c8\u5668\uff0c\u4e0d\u540c\u7684\u5ba2\u6237\u7aef\uff0c\u4f60\u53ef\u4ee5\u4fee\u6539character_set_results\u6765\u4ee5\u4e0d\u540c\u7684\u7f16\u7801\u663e\u793a\u4e2d\u6587\u5b57\u4f53\uff0c\u7531\u4e8eutf8\u662f\u5927\u65b9\u5411\uff0c\u56e0\u6b64web\u5e94\u7528\u662f\u6211\u8fd8\u662f\u503e\u5411\u4e8e\u4f7f\u7528utf8\u683c\u5f0f\u663e\u793a\u4e2d\u6587\u7684\u3002<\/p>\n<\/div>\n<div class=\"clear\"><\/div>\n<div id=\"blog_post_info_block\">\n<div id=\"BlogPostCategory\">\u5206\u7c7b:\u00a0<a href=\"https:\/\/www.cnblogs.com\/wcwen1990\/category\/975948.html\" target=\"_blank\" rel=\"noopener noreferrer\">MySQL<\/a>,<a href=\"https:\/\/www.cnblogs.com\/wcwen1990\/category\/1091684.html\" target=\"_blank\" rel=\"noopener noreferrer\">\u7cbe\u54c1\u533a<\/a><\/div>\n<div id=\"EntryTag\">\u6807\u7b7e:\u00a0<a href=\"https:\/\/www.cnblogs.com\/wcwen1990\/tag\/%E5%8E%9F%E5%88%9B%E6%96%87%E7%AB%A0\/\">\u539f\u521b\u6587\u7ae0<\/a><\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\u5730\u5740 \u4e00\u3001\u5b57\u7b26\u96c6\u548c\u6821\u9a8c\u89c4\u5219 \u5b57\u7b26\u96c6\u662f<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[],"tags":[118],"class_list":["post-3397","post","type-post","status-publish","format-standard","hentry","tag-02-"],"_links":{"self":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/3397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/comments?post=3397"}],"version-history":[{"count":0,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/3397\/revisions"}],"wp:attachment":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/media?parent=3397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/categories?post=3397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/tags?post=3397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}