NutzCN Logo
问答 自动建表失败,很奇怪
发布于 2603天前 作者 蛋蛋的忧伤 1671 次浏览 复制 上一个帖子 下一个帖子
标签:

启动项目自动建表失败,说是utf8mb4啥的问题。。。

15:50:25.168 DEBUG (NutDaoExecutor.java:388) printSQL - CREATE TABLE t_big_content(
id VARCHAR(128),
dt MediumBlob,
PRIMARY KEY (id)
) ENGINE=InnoDB CHARSET=utf8mb4
15:50:25.171 DEBUG (NutDaoExecutor.java:97) exec - SQLException
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown character set: 'utf8mb4'
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_144]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_144]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_144]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_144]
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) ~[mysql-connector-java-5.1.41.jar:5.1.41]
	at com.mysql.jdbc.Util.getInstance(Util.java:408) ~[mysql-connector-java-5.1.41.jar:5.1.41]
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943) ~[mysql-connector-java-5.1.41.jar:5.1.41]
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973) ~[mysql-connector-java-5.1.41.jar:5.1.41]
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909) ~[mysql-connector-java-5.1.41.jar:5.1.41]
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527) ~[mysql-connector-java-5.1.41.jar:5.1.41]
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680) ~[mysql-connector-java-5.1.41.jar:5.1.41]
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2497) ~[mysql-connector-java-5.1.41.jar:5.1.41]
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2455) ~[mysql-connector-java-5.1.41.jar:5.1.41]
	at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:839) ~[mysql-connector-java-5.1.41.jar:5.1.41]
	at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:739) ~[mysql-connector-java-5.1.41.jar:5.1.41]
	at com.alibaba.druid.filter.FilterChainImpl.statement_execute(FilterChainImpl.java:2489) ~[druid-1.0.27.jar:1.0.27]
	at com.alibaba.druid.filter.FilterAdapter.statement_execute(FilterAdapter.java:2451) ~[druid-1.0.27.jar:1.0.27]
	at com.alibaba.druid.filter.FilterEventAdapter.statement_execute(FilterEventAdapter.java:188) ~[druid-1.0.27.jar:1.0.27]
	at com.alibaba.druid.filter.FilterChainImpl.statement_execute(FilterChainImpl.java:2487) ~[druid-1.0.27.jar:1.0.27]
	at com.alibaba.druid.proxy.jdbc.StatementProxyImpl.execute(StatementProxyImpl.java:137) ~[druid-1.0.27.jar:1.0.27]
	at com.alibaba.druid.pool.DruidPooledStatement.execute(DruidPooledStatement.java:418) ~[druid-1.0.27.jar:1.0.27]
	at org.nutz.dao.impl.sql.run.NutDaoExecutor._runStatement(NutDaoExecutor.java:357) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:60) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:66) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:23) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:64) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.impl.interceptor.DaoLogInterceptor.filter(DaoLogInterceptor.java:22) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:64) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.plugins.cache.dao.DaoCacheInterceptor._exec(DaoCacheInterceptor.java:28) ~[nutz-plugins-daocache-1.r.62.jar:?]
	at org.nutz.plugins.cache.dao.CachedNutDaoExecutor.exec(CachedNutDaoExecutor.java:187) ~[nutz-plugins-daocache-1.r.62.jar:?]
	at org.nutz.plugins.cache.dao.DaoCacheInterceptor.filter(DaoCacheInterceptor.java:18) ~[nutz-plugins-daocache-1.r.62.jar:?]
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:64) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.DaoInterceptorChain.invoke(DaoInterceptorChain.java:139) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.impl.sql.run.NutDaoRunner.runCallback(NutDaoRunner.java:158) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.impl.sql.run.NutDaoRunner._runWithoutTransaction(NutDaoRunner.java:125) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.impl.sql.run.NutDaoRunner._run(NutDaoRunner.java:92) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:81) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:240) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:252) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:236) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.impl.NutDao.execute(NutDao.java:1008) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.createEntity(MysqlJdbcExpert.java:167) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.impl.NutDao.create(NutDao.java:812) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.dao.util.Daos.createTablesInPackage(Daos.java:470) ~[nutz-1.r.62.jar:1.r.62]
	at net.wendal.nutzbook.core.CoreMainSetup.init(CoreMainSetup.java:82) ~[nutzcn-core-3.1.0.jar:?]
	at org.nutz.plugins.hotplug.Hotplug.setupInit(Hotplug.java:282) ~[nutz-plugins-hotplug-1.r.63-20171103.110917-119.jar:?]
	at org.nutz.plugins.hotplug.Hotplug.abc(Hotplug.java:380) ~[nutz-plugins-hotplug-1.r.63-20171103.110917-119.jar:?]
	at org.nutz.plugins.hotplug.Hotplug.setupInit(Hotplug.java:311) ~[nutz-plugins-hotplug-1.r.63-20171103.110917-119.jar:?]
	at net.wendal.nutzbook.web.MainSetup.init(MainSetup.java:27) ~[classes/:?]
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:274) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:121) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.plugins.hotplug.Hotplug.load(Hotplug.java:117) ~[nutz-plugins-hotplug-1.r.63-20171103.110917-119.jar:?]
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.mvc.NutFilter._init(NutFilter.java:91) ~[nutz-1.r.62.jar:1.r.62]
	at org.nutz.mvc.NutFilter.init(NutFilter.java:69) ~[nutz-1.r.62.jar:1.r.62]
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279) ~[catalina.jar:8.0.44]
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260) ~[catalina.jar:8.0.44]
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105) ~[catalina.jar:8.0.44]
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4700) ~[catalina.jar:8.0.44]
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5340) ~[catalina.jar:8.0.44]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) ~[catalina.jar:8.0.44]
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753) ~[catalina.jar:8.0.44]
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729) ~[catalina.jar:8.0.44]
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) ~[catalina.jar:8.0.44]
	at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1696) ~[catalina.jar:8.0.44]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_144]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_144]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_144]
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) ~[tomcat-coyote.jar:8.0.44]
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) ~[?:1.8.0_144]
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) ~[?:1.8.0_144]
	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:484) ~[catalina.jar:8.0.44]
	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:433) ~[catalina.jar:8.0.44]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_144]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_144]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_144]
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) ~[tomcat-coyote.jar:8.0.44]
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) ~[?:1.8.0_144]
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) ~[?:1.8.0_144]
	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) ~[?:1.8.0_144]
	at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) ~[?:1.8.0_144]
	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) ~[?:1.8.0_144]
	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) ~[?:1.8.0_144]
	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) ~[?:1.8.0_144]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_144]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_144]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_144]
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357) ~[?:1.8.0_144]
	at sun.rmi.transport.Transport$1.run(Transport.java:200) ~[?:1.8.0_144]
	at sun.rmi.transport.Transport$1.run(Transport.java:197) ~[?:1.8.0_144]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_144]
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196) ~[?:1.8.0_144]
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) ~[?:1.8.0_144]
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) ~[?:1.8.0_144]
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683) ~[?:1.8.0_144]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_144]
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) [?:1.8.0_144]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_144]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_144]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]
package net.wendal.nutzbook.core.bean;

import java.io.Serializable;
import java.sql.Blob;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Name;
import org.nutz.dao.entity.annotation.Table;
import org.nutz.dao.entity.annotation.TableMeta;

/**
 * 专门存放大数据,当KV数据库用
 * @author wendal
 *
 */
@Table("t_big_content")
@TableMeta("{'mysql-charset':'utf8mb4'}")
public class BigContent implements Serializable {

    private static final long serialVersionUID = 1L;

    @Name
	protected String id;
	
	@Column("dt")
	protected Blob data;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Blob getData() {
		return data;
	}

	public void setData(Blob data) {
		this.data = data;
	}
	
}

1 回复

mysql版本太低

添加回复
请先登陆
回到顶部