mysql - 无法在 MySQL 5.5.60 中设置数据类型 datetime(3)
问题描述
我正在尝试将字段从 DATATIME 转换为 DATETIME(3)。服务器版本为 5.5.60-MariaDB。我正在尝试使用工作台 8.0 来做到这一点。我收到“未检测到更改”消息,并且数据类型仍然是 DATETIME。
我尝试了以下代码来更改日期类型:
ALTER TABLE `ALLOCATED_HISTORY`
MODIFY COLUMN `DATE_EFFECTIVE` DATETIME(3) DEFAULT NULL;
当我尝试在工作台的 alter table 中查看表时,我收到 Error Prasing DLL 错误。
解决方案
Mysql 5.5 can't store microseconds, this feature was introduced in 5.6.4.
as of MySQL 5.6.4, any fractional part in a value inserted into a DATETIME or TIMESTAMP column is stored rather than discarded.
推荐阅读
- python - 在python中根据另一个子列表中的相应权重对子列表进行排序
- java - 无法解析 Cargo 跟踪器应用程序的依赖项和插件
- batch-file - 如果批处理中不存在变量
- html - 使网页字体根据 iOS 中的动态类型自动调整大小
- spring - 在@OneToMany 中实现 orphanRemoval
- node.js - 如果 A 和 B 都相同,则 mongodb 复合索引是唯一的
- python - 包函数返回:“值错误:无法插入'列名',已经存在”?
- html - 如何将 vue-select 添加到 JqxScheduler 的对话框中?
- python-3.x - 当附加列表修改时,原始列表中的更改也会更改为之前附加到的列表
- mysql - MySQL 连接表、查找平均评分和排名