xiaocandou

1、直接设置编码格式

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

 

2、修改连接字符串(很有效)

MySQLConnection con = new MySQLConnection("server=127.0.0.1;uid=root;pwd=;database=test;Charset=utf8"); 

3、修改mysql 安装文件my.ini

分类:

技术点:

相关文章:

  • 2021-12-03
  • 2021-10-06
  • 2021-12-03
  • 2021-10-25
  • 2021-07-31
  • 2021-12-03
  • 2021-08-21
  • 2022-12-23
猜你喜欢
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2021-12-03
  • 2021-12-28
  • 2022-12-23
相关资源
相似解决方案