gpt4 book ai didi

mysql - 尝试将 Play 应用程序连接到 mysql 数据库时出现 SQL 语法错误

转载 作者:行者123 更新时间:2023-11-29 22:16:13 26 4
gpt4 key购买 nike

我正在尝试将我的 play2.4 应用程序连接到 MySQL 数据库。应用进化后,我收到以下错误

We got the following error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(6), pickup_date datetime(6), delivery_date datetime(6' at line 14 [ERROR:1064, SQLSTATE:42000], while trying to run this SQL script:

当我检查 php myadmin 时,我发现所有表都已创建,直到到达此表为止:

create table delivery (
id bigint auto_increment not null,
deleted tinyint(1) default 0,
description varchar(500),
notes varchar(1000),
account_id bigint,
customer_id bigint,
sender_id bigint,
recipient_id bigint,
delivery_status_id bigint,
delivery_type_id bigint,
package_type_id bigint,
item_type_id bigint,
call_date datetime(6),
pickup_date datetime(6),
delivery_date datetime(6),
no_of_pieces integer,
cust_type integer,
payment_type integer,
way_bill integer,
created_time datetime(6),
modified_time datetime(6),
createdby_id bigint,
modifiedby_id bigint,
version datetime(6) not null,
constraint pk_delivery primary key (id))

基于此,我猜测在创建此表时会发生错误,但我一直无法找到为什么会出现错误的原因。

最佳答案

DateTime 没有大小。这只是日期时间

call_date                 datetime,
pickup_date datetime,
delivery_date datetime,
...
created_time datetime,
modified_time datetime,
...
version datetime not null,

关于mysql - 尝试将 Play 应用程序连接到 mysql 数据库时出现 SQL 语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31193424/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com