本文转载地址:http://developer.51cto.com/art/200906/130425.htm 感谢相关作者! MySQL默认编码是latin1 mysql> show variables like 'character%'; +--------------------------+--------------------------+ | Variable_name | Value | +--------------------------+------------------…
jdbc:mysql://192.168.1.77:3306/db360?useUnicode=true&characterEncoding=UTF-8 drop database if exists ljdb; create database ljdb character set 'utf8' collate 'utf8_general_ci'; use ljdb; drop table if exists rinfo; create table rinfo( ) ,id bigint ,ab…
今天操作mysql的时候很郁闷,因为修改默认字符集搞了半天,终于弄成了(关于如何把windows的默认字符集设置成功,可以参看另一篇博文,最终在mysql中输入show variables like 'character%'显示的值都是utf8),而后面又出现了录入中文错误,错误信息如下: 1. Data truncation: Data too long for column 'name' at row 1 网上搜了半天,参照http://blog.csdn.net/zoucui/artic…