标签:
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
标签:
原文地址:http://www.cnblogs.com/xiaocandou/p/4677267.html