登录数据库某个语句执行失败,求大佬帮忙看看那个表的字段有问题?

cedar 2019-12-27 836

com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Data too long for column '_target' at row 1         at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:104)         at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:960)         at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1116)         at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1066)         at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1396)         at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1051)         at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:462)         at io.moquette.persistence.DatabaseStore.lambda$persistMessage$0(DatabaseStore.java:496)         at cn.wildfirechat.server.ThreadPoolExecutorWrapper.lambda$execute$0(ThreadPoolExecutorWrapper.java:37)         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)         at java.util.concurrent.FutureTask.run(FutureTask.java:266)         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)         at java.lang.Thread.run(Thread.java:748)  Total time for which application threads were stopped: 0.0000972 seconds, Stopping threads took: 0.0000225 seconds  com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Data too long for column '_uid' at row 1         at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:104)         at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:960)         at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1116)         at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1066)         at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1396)         at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1051)         at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:462)         at io.moquette.persistence.DatabaseStore.lambda$persistUserMessage$2(DatabaseStore.java:779)         at cn.wildfirechat.server.ThreadPoolExecutorWrapper.lambda$execute$0(ThreadPoolExecutorWrapper.java:37)         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)         at java.util.concurrent.FutureTask.run(FutureTask.java:266)         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)         at java.lang.Thread.run(Thread.java:748)

最新回复 (6)
  • x86 2019-12-28
    引用 2
    Data too long for column '_target'

    t_messages_xxx 表
  • cedar 2019-12-29
    引用 3
    x86 Data too long for column '_target' t_messages_xxx 表
    Data too long for column '_uid' 
    Data too long for column '_target'
    我看到是有两个字段都报了这个错,在登录的时候
  • HeavyRain 2020-1-2
    引用 4
    用户id是不是自己生成的,长度是多少
  • cedar 2020-1-6
    引用 5
    HeavyRain 用户id是不是自己生成的,长度是多少
    没有自己生成,是IMServer 生成返回的
  • cedar 2020-1-6
    引用 6
    HeavyRain 用户id是不是自己生成的,长度是多少
    现在是数据表字段是64位
  • x86 2020-1-6
    引用 7
    你好,可以参考下这个链接。

    https://dba.stackexchange.com/questions/145368/data-too-long-for-column-mysql-error
返回