mysql处理特殊字符

修改表
alter table USER convert to charset utf8mb4, character set utf8mb4;
改列
ALTER TABLE USER DEFAULT CHARACTER SET utf8mb4,
  modify REALNAME varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

SHOW FULL COLUMNS FROM `user`  ;  这个是检查当前编码
show CREATE TABLE USER; 查看表编码
show VARIABLES LIKE '%char%'
rename table abc to ABC
 
mysql 配置文件配置详解
http://dev.mysql.com/doc/refman/5.7/en/server-options.html#option_mysqld_character-set-client-handshake
 
mysql数据库5.5以上版本支持utf8mb4
同时配置文件采用utf8mb4设置
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[client]
default-character-set = utf8mb4
 
mysql表大小写问题
http://dev.mysql.com/doc/refman/5.7/en/identifier-case-sensitivity.html
posted @ 2016-05-30 17:27  快乐就好  阅读(13653)  评论(0编辑  收藏  举报