如何编译安装mysql中的字符集

  

本文主要给大家简单讲讲如何编译安装mysql中的字符集,相关专业术语大家可以上网查查或者找一些相关书籍补充一下,这里就不涉猎了,我们就直奔主题吧,希望如何编译安装mysql中的字符集这篇文章可以给大家带来一些实际帮助。

1。编译安装的字符集情况

<>之前查看字符集的格式   mysql>, show , create , table , sanlang  \ G   * * * * * * * * * * * * * * * * * * * * * * * * * * *,1只row  * * * * * * * * * * * * * * * * * * * * * * * * * * *   ,,,,,,表:sanlang   Create 表:,Create  TABLE “sanlang”, (   “id”才能,int (11), DEFAULT 空,   “名字”,才能varchar (10), DEFAULT  NULL   ),引擎=InnoDB  DEFAULT  CHARSET=utf8   1,row  set 拷贝;(0.00,sec)   ,   mysql>   插入数据   mysql>, insert  into , sanlang ,值(22日,“刘海笑“),,,,   ,   Query 好吧,,1,row  affected (0.00,秒)   测试   mysql>, select  *,得到sanlang;,,,,,,,,,,,,,,,,,,,   + - - - - - - - - - - - - - - - - - - +   |,id ,, |, name ,,,, |   + - - - - - - - - - - - - - - - - - - +   |,,,,1,|,xiaoming  |   |,,,,2,|,xiaoli ,, |   |,,,,3,|,tt ,,,,,, |   |,,,,4,|,gg ,,,,,, |   |,,,22,|,testdata  |   |,,,22,|,刘海笑,,,|   + - - - - - - - - - - - - - - - - - - +   6,rows  set 拷贝;(0.00,sec)   mysql>

更改字符集测试(更改字符集以后可以看出id为22的出现乱码):

 mysql>, set , names , gbk ;
  Query 好吧,,0,rows  affected (0.00,秒)
  ,
  mysql>, select  *,得到sanlang;,,,,,,,,,,,,,,,,,,,,,,
  + - - - - - - - - - - - - - - - - - +
  |,id ,, |, name ,,, |
  + - - - - - - - - - - - - - - - - - +
  |,,,,1,|,xiaoming  |
  |,,,,2,|,xiaoli , |
  |,,,,3,|,tt ,,,,, |
  |,,,,4,|,gg ,,,,, |
  |,,,22,|,testdata  |
  |,,,22,|,Ц ,,,,,, |
  + - - - - - - - - - - - - - - - - - +
  6,rows  set 拷贝;(0.10,sec)
  ,
  mysql> 

2。mysql数据库常见的字符集介绍

如何编译安装mysql中的字符集

3. mysql如何选择合适的字符集

 1。如果处理各种各样的文字,发布到不同一眼国家地区,mysql来说utf - 8(每个汉字三个自己),如果应用需要处理英文,仅有少量汉字utf8更好
  2 .如果只需要支持中文,并且数据量很大,性能要求也很高,可选GBK(订场,每个汉字占用双字节,英文也占双字节),如需大量的运算,
  比较排序等,定长字符集,更快,性能高
  3 .处理移动互联网业务,可能需要使用utf8MP4的字符集
  4 .老师建议:没有特别的需求,就选择utf8的字符集

4。查看系统字符集

 mysql>, show , character  set ;
  mysql>, show , variables , like  & # 39; character_set % & # 39;;
  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
  |,Variable_name ,,,,,,,,,,, |, Value ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, |
  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
  |,character_set_client ,,,, |, utf8 ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, |,, #客户端字符集
  | |,character_set_connection  utf8 ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, | #客户端连接字符集
  |,character_set_database ,, |, utf8 ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, | #数据库字符集,配置文件指定或者建表指定
  | |,character_set_filesystem  binary ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, | #文件系统字符集
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null

如何编译安装mysql中的字符集