解决SQLSyntaxErrorException: Incorrect table definition; there can be only one auto column and it must

2022/9/15 2:17:17

本文主要是介绍解决SQLSyntaxErrorException: Incorrect table definition; there can be only one auto column and it must,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

问题描述

mysql数据库使用sql建表语句新建一张表,并还有自增的列

Caused by: java.sql.SQLSyntaxErrorException: Incorrect table definition; there can be only one auto column and it must be defined as a key

问题分析

java.sql。SQLSyntaxErrorException:表定义不正确;只能有一个自动列,必须将其定义为键

有自动增长的列,但是该列没有设置主键;

解决方案

  在创建表的SQL中,添加PRIMARY KEY (`LOG_NR_`)

 



这篇关于解决SQLSyntaxErrorException: Incorrect table definition; there can be only one auto column and it must的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程