gpt4 book ai didi

mysql - 无法使用 unix_timestamp 函数添加更新事件

转载 作者:行者123 更新时间:2023-11-29 15:13:51 25 4
gpt4 key购买 nike

我有 10.3.9-MariaDB-1:10.3.9+maria~bionic 数据库服务器。在我的表配置文件中,我有一个带有默认 unix_timestamp() 的字段。但是当我尝试为更新事件添加此功能时

 alter table profile change `updated_at` `updated_at` int(11) NOT NULL DEFAULT UNIX_TIMESTAMP() ON UPDATE UNIX_TIMESTAMP();

它给了我语法错误:

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNIX_TIMESTAMP()' at line 1

最佳答案

查看评论。我有一些好人在评论中给出的两种可能的解释:1)我有不同版本的 mariadB2)MariaDB文档甚至没有表的更新触发器描述,所以如果你甚至可以为更新触发器添加func,我就没有。

关于mysql - 无法使用 unix_timestamp 函数添加更新事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59856142/

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