{"id":269,"date":"2015-11-29T09:22:02","date_gmt":"2015-11-29T01:22:02","guid":{"rendered":"http:\/\/cn.hostease.com\/xueyuan\/?p=269"},"modified":"2015-11-29T09:22:02","modified_gmt":"2015-11-29T01:22:02","slug":"%e5%85%b3%e4%ba%8emysql%e4%b8%ad%e6%96%87%e4%b9%b1%e7%a0%81%e9%97%ae%e9%a2%98%e8%af%a5%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3","status":"publish","type":"post","link":"https:\/\/cn.hostease.com\/xueyuan\/uncategorized\/%e5%85%b3%e4%ba%8emysql%e4%b8%ad%e6%96%87%e4%b9%b1%e7%a0%81%e9%97%ae%e9%a2%98%e8%af%a5%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3\/","title":{"rendered":"\u5173\u4e8eMysql\u4e2d\u6587\u4e71\u7801\u95ee\u9898\u8be5\u5982\u4f55\u89e3\u51b3"},"content":{"rendered":"<p><strong>\u9996\u5148\uff1a<\/strong><span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u7528show variables like \u201c%colla%\u201d\uff1bshow varables like \u201c%char%\u201d\uff1b\u8fd9\u4e24\u6761\u547d\u4ee4\u67e5\u770b\u6570\u636e\u5e93\u4e0e\u670d\u52a1\u7aef\u7684\u5b57\u7b26\u96c6\u8bbe\u7f6e<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u5982\u679c\u67e5\u770b\u51fa\u6765\u90fd\u662fgbk2312\uff0c\u6216 gbk\uff0c\u90a3\u4e48\u5c31\u53ea\u80fd\u652f\u6301\u7b80\u4f53\u4e2d\u6587\uff0c\u7e41\u4f53\u548c\u4e00\u4e9b\u7279\u6b8a\u7b26\u53f7\u662f\u4e0d\u80fd\u63d2\u5165\u7684\uff0c\u6211\u4eec\u53ea\u6709\u4fee\u6539\u5b57\u7b26\u96c6\u4e3aUTF-8\uff0c<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p><strong>\u4fee\u6539\u65b9\u6cd5\u5982\u4e0b\uff1a<\/strong><span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u7528\u8bb0\u4e8b\u672c\u6216UitraEdit\u6253\u5f00mysql\u6570\u636e\u5e93\u5b89\u88c5\u76ee\u5f55\u4e0b\u7684my.ini\u6587\u4ef6\u6253\u5f00\uff0c \u7136\u540eCtrl+F\u641c\u7d22default-character-set\uff0c\u5c06\u540e\u9762\u7684\u5b57\u7b26\u96c6\u4fee\u6539\u4e3aUTF8\uff0c\u6ce8\u610f\u8981\u4fee\u6539\u4e24\u4e2a\u5730\u65b9\uff0c\u4e00\u4e2a\u4e8b\u5ba2\u6237\u7aef\u7684\uff0c\u4e00\u4e2a\u662f\u670d\u52a1\u7aef\u7684\u3002<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u7136\u540e\u4fdd\u5b58\uff0c\u91cd\u542fmysql\u670d\u52a1\u3001\u3001\u8fdb\u53bb\u7ee7\u7eed\u7528show variables like \u201c%colla%\u201d\uff1bshow variables like \u201c%char%\u201d\uff1b\u7740\u4e24\u6761\u8bed\u53e5\u67e5\u8be2\u4e00\u4e0b\u5b57\u7b26\u96c6, \u5230\u6b64\u5c31\u914d\u7f6e\u5b8c\u6210\u4e86\u3002<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u6ce8\u610f\uff1a<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u5982\u679c\u4ee5\u524d\u5efa\u6709\u6570\u636e\u5e93\u6ca1\u6709\u5220\u9664\u7684 \u8bf7\u7528 show database \u6570\u636e\u5e93\u540d\uff1b\u548c show create table \u8868\u540d\uff1b\u67e5\u770b\u4e00\u4e0b\u6570\u636e\u5e93\u548c\u8868\u7684\u5b57\u7b26\u96c6\u662f\u5426\u4e3aUTF8 \uff0c \u56e0\u4e3a\u4fee\u6539my.ini\u6587\u4ef6\uff0c\u5b83\u4e0d\u80fd\u4fee\u6539\u539f\u6765\u6570\u636e\u5e93\u7684\u7684\u5b57\u7b26\u96c6\u3002\u5728\u547d\u4ee4\u884c\u4e0b\u9762\u53ef\u4ee5\u7528<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>alter database \u6570\u636e\u5e93\u540d character set \u201c\u5b57\u7b26\u96c6\u201d\uff1b \u547d\u4ee4\u6765\u4fee\u6539\u6570\u636e\u5e93\u5b57\u7b26\u96c6<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u8fd8\u6709\u4e00\u70b9\u8981\u6ce8\u610f\u7684\u662f\uff0c\u4fee\u6539\u4e3aUTF8\u4ee5\u540e\uff0c\u5728\u547d\u4ee4\u884c\u4e0b\u9762\u4e2d\u6587\u662f\u4e71\u7801\u7684\uff0c\u53ea\u8f93\u51fa\u5230\u9875\u9762\u6216\u63a7\u5236\u53f0\u662f\u6b63\u5e38\u7684\uff0c\u8fd9\u4e2a\u95ee\u9898\u6211\u4e5f\u4e0a\u7f51\u67e5\u4e86\u4e00\u4e0b\uff0c\u8c8c\u4f3c\u547d\u4ee4\u884c\u4e0b\u9762\u4e0d\u652f\u6301UTF8\uff0c\u6211\u4e5f\u4e0d\u592a\u6e05\u695a\u3002<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u5f53\u4fee\u6539\u4ee5\u540e\uff0c\u5728\u547d\u4ee4\u884c\u4e0b\u9762\u5982\u679c\u8981\u63d2\u5165\u4e2d\u6587\uff0c\u53ef\u4ee5\u5728\u63d2\u5165\u8bed\u53e5\u4e4b\u524d\u6267\u884c\uff0cset names gbk2312\uff1b\u5c31\u53ef\u4ee5\u63d2\u5165\u4e2d\u6587\u4e86\uff0c\u4f46\u662f\u4e0d\u80fd\u63d2\u5165\u7e41\u4f53\u548c\u4e00\u4e9b\u7279\u6b8a\u7b26\u53f7\u3002<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u8fd9\u51e0\u5929\u89e3\u51b3\u4e71\u7801\u7684\u6210\u679c\u3002\u5e0c\u671b\u5404\u4f4d\u5927\u867e\u591a\u591a\u6307\u6559\u3002<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u4e0b\u9762\u62bd\u70b9\u7a7a\u7ed9\u5927\u5bb6\u6574\u7406\u4e9b\u5173\u4e8eMySQL\u4f1a\u51fa\u73b0\u4e2d\u6587\u4e71\u7801\u7684\u539f\u56e0\u4e0d\u5916\u4e4e\u4e0b\u5217\u51e0\u70b9\u3002<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>1.server\u672c\u8eab\u8bbe\u5b9a\u95ee\u9898\uff0c\u4f8b\u5982\u8fd8\u505c\u7559\u5728latin1<br \/>\n2.table\u7684\u8bed\u7cfb\u8bbe\u5b9a\u95ee\u9898(\u5305\u542bcharacter\u4e0ecollation)<br \/>\n3.\u5ba2\u6237\u7aef\u7a0b\u5f0f(\u4f8b\u5982php)\u7684\u8fde\u7ebf\u8bed\u7cfb\u8bbe\u5b9a\u95ee\u9898<br \/>\n<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u5f3a\u70c8\u5efa\u8bae\u4f7f\u7528utf8!!!!<br \/>\n<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>utf8\u53ef\u4ee5\u517c\u5bb9\u4e16\u754c\u4e0a\u6240\u6709\u5b57\u7b26!!!!<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u4e00\u3001\u907f\u514d\u521b\u5efa\u6570\u636e\u5e93\u53ca\u8868\u51fa\u73b0\u4e2d\u6587\u4e71\u7801\u548c\u67e5\u770b\u7f16\u7801\u65b9\u6cd5<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p><strong>1\u3001\u521b\u5efa\u6570\u636e\u5e93\u7684\u65f6\u5019\uff1a<\/strong><span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>CREATE DATABASE `test` CHARACTER SET &#8216;utf8&#8217; COLLATE &#8216;utf8_general_ci&#8217;;<\/p>\n<p><strong>2\u3001\u5efa\u8868\u7684\u65f6\u5019 <\/strong><span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>CREATE TABLE `database_user` ( `ID` varchar(40) NOT NULL default &#8221;, `UserID` varchar(40) NOT NULL default &#8221;, ) ENGINE=InnoDB DEFAULT CHARSET=utf8;<\/p>\n<p>\u8fd93\u4e2a\u8bbe\u7f6e\u597d\u4e86\uff0c\u57fa\u672c\u5c31\u4e0d\u4f1a\u51fa\u95ee\u9898\u4e86,\u5373\u5efa\u5e93\u548c\u5efa\u8868\u65f6\u90fd\u4f7f\u7528\u76f8\u540c\u7684\u7f16\u7801\u683c\u5f0f\u3002<br \/>\n<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u4f46\u662f\u5982\u679c\u4f60\u5df2\u7ecf\u5efa\u4e86\u5e93\u548c\u8868\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u8fdb\u884c\u67e5\u8be2\u3002<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p><strong>1.\u67e5\u770b\u9ed8\u8ba4\u7684\u7f16\u7801\u683c\u5f0f:<\/strong><span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>mysql show variables like &#8220;%char%&#8221;; +&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;+ | Variable_name | Value | +&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;+ | character_set_client | gbk | | character_set_connection | gbk | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | gbk | | character_set_server | utf8 | | character_set_system | utf8 | +&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;-+<\/p>\n<p>\u6ce8\uff1a\u4ee5\u524d2\u4e2a\u6765\u786e\u5b9a,\u53ef\u4ee5\u4f7f\u7528set names utf8,set names gbk\u8bbe\u7f6e\u9ed8\u8ba4\u7684\u7f16\u7801\u683c\u5f0f;<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u6267\u884cSET NAMES utf8\u7684\u6548\u679c\u7b49\u540c\u4e8e\u540c\u65f6\u8bbe\u5b9a\u5982\u4e0b\uff1a<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>SET character_set_client=&#8217;utf8&#8242;; SET character_set_connection=&#8217;utf8&#8242;; SET character_set_results=&#8217;utf8&#8242;;<\/p>\n<p><strong>2.\u67e5\u770btest\u6570\u636e\u5e93\u7684\u7f16\u7801\u683c\u5f0f:<\/strong><span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>mysql show create database test; +&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+ | Database | Create Database | +&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+ | test | CREATE DATABASE `test` \/*!40100 DEFAULT CHARACTER SET gbk *\/ | +&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<\/p>\n<p><strong>3.\u67e5\u770byjdb\u6570\u636e\u8868\u7684\u7f16\u7801\u683c\u5f0f:<\/strong><span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>mysql show create table yjdb; | yjdb | CREATE TABLE `yjdb` ( `sn` int(5) NOT NULL AUTO_INCREMENT, `type` varchar(10) NOT NULL, `brc` varchar(6) NOT NULL, `teller` int(6) NOT NULL, `telname` varchar(10) NOT NULL, `date` int(10) NOT NULL, `count` int(6) NOT NULL, `back` int(10) NOT NULL, PRIMARY KEY (`sn`), UNIQUE KEY `sn` (`sn`), UNIQUE KEY `sn_2` (`sn`) ) ENGINE=MyISAM AUTO_INCREMENT=1826 DEFAULT CHARSET=gbk ROW_FORMAT=DYNAMIC |<\/p>\n<p>\u4e8c\u3001\u907f\u514d\u5bfc\u5165\u6570\u636e\u6709\u4e2d\u6587\u4e71\u7801\u7684\u95ee\u9898<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p><strong>1:\u5c06\u6570\u636e\u7f16\u7801\u683c\u5f0f\u4fdd\u5b58\u4e3autf-8<\/strong><span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u8bbe\u7f6e\u9ed8\u8ba4\u7f16\u7801\u4e3autf8\uff1a<br \/>\n<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>set names utf8;<br \/>\n<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u8bbe\u7f6e\u6570\u636e\u5e93db_name\u9ed8\u8ba4\u4e3autf8:<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>ALTER DATABASE `db_name` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;<\/p>\n<p>\u8bbe\u7f6e\u8868tb_name\u9ed8\u8ba4\u7f16\u7801\u4e3autf8:<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>ALTER TABLE `tb_name` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;<\/p>\n<p>\u5bfc\u5165\uff1a<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>LOAD DATA LOCAL INFILE &#8216;C:\\\\utf8.txt&#8217; INTO TABLE yjdb;<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p><strong>2:\u5c06\u6570\u636e\u7f16\u7801\u683c\u5f0f\u4fdd\u5b58\u4e3aansi(\u5373GBK\u6216GB2312)<\/strong><span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u8bbe\u7f6e\u9ed8\u8ba4\u7f16\u7801\u4e3agbk\uff1a<br \/>\n<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>set names gbk;<br \/>\n<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u8bbe\u7f6e\u6570\u636e\u5e93db_name\u9ed8\u8ba4\u7f16\u7801\u4e3agbk:<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>ALTER DATABASE `db_name` DEFAULT CHARACTER SET gbk COLLATE gbk_chinese_ci;<\/p>\n<p>\u8bbe\u7f6e\u8868tb_name\u9ed8\u8ba4\u7f16\u7801\u4e3agbk:<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>ALTER TABLE `tb_name` DEFAULT CHARACTER SET gbk COLLATE gbk_chinese_ci;<\/p>\n<p>\u5bfc\u5165\uff1a<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>LOAD DATA LOCAL INFILE &#8216;C:\\\\gbk.txt&#8217; INTO TABLE yjdb;<br \/>\n<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u6ce8\uff1a1.UTF8\u4e0d\u8981\u5bfc\u5165gbk\uff0cgbk\u4e0d\u8981\u5bfc\u5165UTF8;<br \/>\n<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p><strong>2.dos\u4e0b\u4e0d\u652f\u6301UTF8\u7684\u663e\u793a;<\/strong><span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u4e09\u3001\u89e3\u51b3\u7f51\u9875\u4e2d\u4e71\u7801\u7684\u95ee\u9898<br \/>\n<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u5c06\u7f51\u7ad9\u7f16\u7801\u8bbe\u4e3a utf-8,\u8fd9\u6837\u53ef\u4ee5\u517c\u5bb9\u4e16\u754c\u4e0a\u6240\u6709\u5b57\u7b26\u3002<br \/>\n<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>\u5982\u679c\u7f51\u7ad9\u5df2\u7ecf\u8fd0\u4f5c\u4e86\u597d\u4e45,\u5df2\u6709\u5f88\u591a\u65e7\u6570\u636e,\u4e0d\u80fd\u518d\u66f4\u6539\u7b80\u4f53\u4e2d\u6587\u7684\u8bbe\u5b9a,\u90a3\u4e48\u5efa\u8bae\u5c06\u9875\u9762\u7684\u7f16\u7801\u8bbe\u4e3a GBK, GBK\u4e0eGB2312\u7684\u533a\u522b\u5c31\u5728\u4e8e:GBK\u80fd\u6bd4GB2312\u663e\u793a\u66f4\u591a\u7684\u5b57\u7b26,\u8981\u663e\u793a\u7b80\u4f53\u7801\u7684\u7e41\u4f53\u5b57,\u5c31\u53ea\u80fd\u7528GBK\u3002<br \/>\n<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>1.\u7f16\u8f91\/etc\/my.cnf\u3000,\u5728[mysql]\u6bb5\u52a0\u5165default_character_set=utf8;<br \/>\n<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>2.\u5728\u7f16\u5199Connection URL\u65f6\uff0c\u52a0\u4e0auseUnicode=true<br \/>\n<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09<\/span><\/p>\n<p>3.\u5728\u7f51\u9875\u4ee3\u7801\u4e2d\u52a0\u4e0a\u4e00\u4e2a&#8221;set names utf8&#8243;\u6216\u8005&#8221;set names gbk&#8221;\u7684\u6307\u4ee4\uff0c\u544a\u8bc9MySQL\u8fde\u7ebf\u5185\u5bb9\u90fd\u8981\u4f7f\u7528utf8\u6216\u8005gbk;<span style=\"color: #ffffff;font-family: Arial\">\uff08\u8054\u76df<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\uff1a\uff08\u8054\u76df\u7535\u8111:https:\/\/it.010lm.com\uff09 \u7528show variables like \u201c%c &#8230; <a title=\"\u5173\u4e8eMysql\u4e2d\u6587\u4e71\u7801\u95ee\u9898\u8be5\u5982\u4f55\u89e3\u51b3\" class=\"read-more\" href=\"https:\/\/cn.hostease.com\/xueyuan\/uncategorized\/%e5%85%b3%e4%ba%8emysql%e4%b8%ad%e6%96%87%e4%b9%b1%e7%a0%81%e9%97%ae%e9%a2%98%e8%af%a5%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3\/\" aria-label=\"\u9605\u8bfb \u5173\u4e8eMysql\u4e2d\u6587\u4e71\u7801\u95ee\u9898\u8be5\u5982\u4f55\u89e3\u51b3\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-269","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/comments?post=269"}],"version-history":[{"count":1,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/269\/revisions"}],"predecessor-version":[{"id":270,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/269\/revisions\/270"}],"wp:attachment":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/media?parent=269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/categories?post=269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/tags?post=269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}