免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 7462 | 回复: 4
打印 上一主题 下一主题

ERROR 1406 (22001): Data too long for column 是何故? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-04-18 14:42 |只看该作者 |倒序浏览
C:\Documents and Settings\Administrator>mysql wap
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 32 to server version: 5.0.18-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> insert into catalog (name,pagesize) values("彩信资源",4);
ERROR 1406 (22001): Data too long for column 'name' at row 1
mysql> show variables like '%char%';
+--------------------------+----------------------------------------------------
----+
| Variable_name            | Value
    |
+--------------------------+----------------------------------------------------
----+
| character_set_client     | utf8
    |
| character_set_connection | utf8
    |
| character_set_database   | utf8
    |
| character_set_results    | utf8
    |
| character_set_server     | utf8
    |
| character_set_system     | utf8
    |
| character_sets_dir       | C:\Program Files\MySQL\MySQL Server 5.0 hare\charse
ts\ |
+--------------------------+----------------------------------------------------
----+
7 rows in set (0.00 sec)

mysql> show create table catalog;
+---------+---------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-------+
| Table   | Create Table


       |
+---------+---------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-------+
| catalog | CREATE TABLE `catalog` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `parentID` int(11) default NULL,
  `pageSize` int(3) default '4',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 |
+---------+---------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-------+
1 row in set (0.00 sec)

mysql>


`name` varchar(255)了,还不够长?疑惑ing

论坛徽章:
0
2 [报告]
发表于 2006-04-18 15:57 |只看该作者
试了下,没有出现问题
比较怪

论坛徽章:
0
3 [报告]
发表于 2006-04-18 16:01 |只看该作者
我的mysql最近老出状况:

http://bbs.chinaunix.net/viewthr ... ge=1&highlight=

论坛徽章:
0
4 [报告]
发表于 2007-02-01 12:09 |只看该作者

论坛徽章:
0
5 [报告]
发表于 2007-02-01 21:08 |只看该作者
http://imysql.cn/?q=node/20

先执行

  1. SET NAMES utf8;
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP