rhel4 mysql5.5字符集_客戶端mysql亂碼處理

wisdomone1發表於2010-06-21

   mysql5.5預設採用的字符集是latin1,透過檢視建表的ddl語句,發現表的預設字符集為gbk,最終修改character_set_results為gbk,漢字得以正常顯示,亂碼喲,好好研究下;

 

mysql> set character_set_results='gbk2312';
ERROR 1115 (42000): Unknown character set: 'gbk2312'
mysql> set character_set_results='gbk';
Query OK, 0 rows affected (0.00 sec)

mysql> select msg_id,content_member,content_admin from auxi_msg;
+--------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| msg_id | content_member                        | content_admin                                                                                                                                                                                                                                                                                             |
+--------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|      1 | 請問JEECMS v2.4版什麼時候釋出?  | JEECMS v2.4版定於2010年1月15日上午10點發布,敬請關注!                                                                                                                                                                                                                                               |

7、整站(主站與子站點)搜尋  |?  | JEECMS v2.4版新增了以下功能:
|      3 | 11111111111                           | NULL                                                                                                                                                                                                                                                                                                      |
+--------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)

mysql> show create table auxi_msg; #檢視錶auxi_msg的建表ddl語句
+----------+----------------------------------------------------------------------------------------------------------------------------------+
| Table    | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
----------------------------------+
| auxi_msg | CREATE TABLE `auxi_msg` (
  `MSG_ID` bigint(20) NOT NULL AUTO_INCREMENT,
  `ADMIN_ID` bigint(20) DEFAULT NULL,
  `MSGCTG_ID` bigint(20) NOT NULL,
  `WEBSITE_ID` bigint(20) NOT NULL,
  `MEMBER_ID` bigint(20) DEFAULT NULL,
  `CONFIG_ID` bigint(20) NOT NULL,
  `TITLE` varchar(200) DEFAULT NULL COMMENT 'á???±êìa',
  `CONTENT_MEMBER` longtext COMMENT 'á????úèY',
  `CONTENT_ADMIN` longtext COMMENT '???′?úèY',
  `EMAIL` varchar(100) DEFAULT NULL COMMENT 'μ?×óóê??',
  `PHONE` varchar(100) DEFAULT NULL COMMENT 'áa?μμ??°',
  `QQ` varchar(50) DEFAULT NULL COMMENT 'QQ',
  `IP` varchar(20) DEFAULT NULL COMMENT 'á???IP',
  `CREATE_TIME` datetime DEFAULT NULL COMMENT 'á???ê±??',
  `REPLY_TIME` datetime DEFAULT NULL COMMENT '???′ê±??',
  `IS_CHECK` tinyint(1) NOT NULL COMMENT 'ê?·?éóo?',
  `IS_RECOMMEND` tinyint(1) NOT NULL COMMENT 'ê?·?í???',
  `IS_DISABLED` tinyint(1) NOT NULL COMMENT 'ê?·???ó?',
  PRIMARY KEY (`MSG_ID`),
  KEY `FK_AMSG_ADMIN` (`ADMIN_ID`),
  KEY `FK_AMSG_MEMBER` (`MEMBER_ID`),
  KEY `FK_AMSG_MSGCTG` (`MSGCTG_ID`),
  KEY `FK_AMSG_WEBSITE` (`WEBSITE_ID`),
  KEY `FK_AUXIMSG_CONFIG` (`CONFIG_ID`),
  KEY `FK8AF99647239FDD98` (`MEMBER_ID`),
  KEY `FK8AF99647E0DAA180` (`CONFIG_ID`),
  KEY `FK8AF9964716B9157C` (`ADMIN_ID`),
  KEY `FK8AF99647FF34817C` (`WEBSITE_ID`),
  KEY `FK8AF99647460F367B` (`MSGCTG_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=gbk COMMENT='á???°?á???' |
+----------+----------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql>

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-665800/,如需轉載,請註明出處,否則將追究法律責任。

相關文章