**

#<张小白> Ubuntu系统添加中文方式

**
近期在使用Ubuntu时发现在使用MySQL时,自己无法在创建的表中添加中文。
网上查找了一些方法:
⭐指定位置修改:
alter table [表名] modify [列名] char(20) character set gbk;
⭐永久修改:
1、命令行进入MySQL中

mysql -u root -p

Ubuntu系统添加中文方式
2、输入下面命令

show variables like "% character %"; 

Ubuntu系统添加中文方式
3、修改编码方式,将所有的编码方式都换为utf-8

set character_set_client = utf8;
set character_set_server = utf8;
set character_set_connection = utf8;
set character_set_database = utf8;
set character_set_filesystem = utf8;
set character_set_results = utf8;
set collation_connection = utf8_general_ci;
set collation_database = utf8_general_ci;
set collation_server = utf8_general_ci;

4、再次查看编码方式

show variables like "% character %"; 

Ubuntu系统添加中文方式
这样就可以在表中插入中文了。????

相关文章:

  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
  • 2021-10-12
  • 2021-10-02
  • 2021-10-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-30
  • 2021-12-04
  • 2022-12-23
相关资源
相似解决方案