MySQL trunc规格严格

MySQL trunc规格严格,第1张

Hi
  I am trying to insert my file content to the Mysql 5.0, i am trying
to insert 1000 files, but when inserting some of the file, i got an
exception, why?

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data truncated for
column 'content' at row 1
    at
com.mysql.jdbc.SQLError.convertShowWarningsToSQLWarnings(SQLError.java:709)
    at
com.mysql.jdbc.MysqlIO.scanForAndThrowDataTruncation(MysqlIO.java:3461)
    at
com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1198)
    at
com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:677)
    at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1357)
    at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1274)
    at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1259)

The file that cause the exception is arround 85KB. and here is the
table structure:

CREATE TABLE `articles` (
`id` int(11) NOT NULL auto_increment,
`major` text NOT NULL,
`minor` text NOT NULL,
`author` text NOT NULL,
`url` text NOT NULL,
`topic` text NOT NULL,
`content` text NOT NULL,
`filename` text NOT NULL,
`filesize` int(11) NOT NULL default '0',
`date` datetime NOT NULL default '0000-00-00 00:00:00',
`rank` int(11) NOT NULL default '0',\n  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=gb2312

thanks
from Peter ([email protected])

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/2092084.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-07-22
下一篇 2022-07-22

发表评论

登录后才能评论

评论列表(0条)

保存