ITADN

外部mysql建表问题

#7518OpenOneTian1211 创建于 2026-06-15
bug
O
OneTian1211commented
### 📑 I have found these related issues/pull requests uptime kuma版本2.4.0 mysql版本5.7.36 使用内置MariaDB 数据库正常,但是切换到外部mysql数据库时报错 ERROR 1101 (42000) at line 1076183: BLOB, TEXT, GEOMETRY or JSON column 'days_of_month' can't have a default value <img width="2526" height="744" alt="Image" src="https://github.com/user-attachments/assets/6bf10db8-fab2-4acc-8390-bb0774cbf181" /> ### 🛡️ Security Policy - [x] I have read and agree to Uptime Kuma's [Security Policy](https://github.com/louislam/uptime-kuma/security/policy). ### 📝 Description _No response_ ### 👟 Reproduction steps 直接新建容器,并在web页面选择mysql数据库 <!-- Failed to upload "image.png" --> ### 👀 Expected behavior 表字段类型及默认值有问题 ### 😓 Actual Behavior 表字段类型及默认值有问题 ### 🐻 Uptime-Kuma Version 2.4.0 ### 💻 Operating System and Arch centos ### 🌐 Browser Edge ### 🖥️ Deployment Environment - **Runtime Environment**: - MySQL: Version `5.7.36` - Kubernetes (K3S/K8S): Version `1.22.17` - **Database**: - mysql - **Database Storage**: - **Filesystem**: - Linux: XFS ### 📝 Relevant log output ```bash session 身份验证成功 Welcome to Uptime Kuma Your Node.js version: 22.22.3 2026-06-15T02:23:01Z [SERVER] INFO: Env: production 2026-06-15T02:23:02Z [SERVER] INFO: Uptime Kuma Version: 2.4.0 2026-06-15T02:23:02Z [SERVER] INFO: Loading modules 2026-06-15T02:23:03Z [SERVER] INFO: Creating express and socket.io instance 2026-06-15T02:23:03Z [SERVER] INFO: Server Type: HTTP 2026-06-15T02:23:03Z [SERVER] INFO: Data Dir: ./data/ 2026-06-15T02:23:03Z [SETUP-DATABASE] INFO: db-config.json is not found or invalid: ENOENT: no such file or directory, open 'data/db-config.json' 2026-06-15T02:23:03Z [SETUP-DATABASE] INFO: Starting Setup Database 2026-06-15T02:23:03Z [SETUP-DATABASE] INFO: Listening on: 2026-06-15T02:23:03Z [SETUP-DATABASE] INFO: - http://localhost:3001 2026-06-15T02:23:03Z [SETUP-DATABASE] INFO: - http://172.20.210.252:3001 2026-06-15T02:23:03Z [SETUP-DATABASE] INFO: Waiting for user action... Request /setup-database-info Request /setup-database-info 2026-06-15T02:23:36Z [SETUP-DATABASE] INFO: Testing database connection... 2026-06-15T02:23:36Z [SETUP-DATABASE] INFO: Database is configured, close the setup-database server and start the main server now. 2026-06-15T02:23:36Z [SETUP-DATABASE] INFO: The setup-database server is closed 2026-06-15T02:23:36Z [DB] INFO: Database Type: mariadb 2026-06-15T02:23:36Z [SERVER] INFO: Connected to the database migration file "2025-02-15-2312-add-wstest.js" failed migration failed with error: alter table `monitor` add `ws_ignore_sec_websocket_accept_header` boolean not null default '0', add `ws_subprotocol` varchar(255) not null default '' - Table 'kuma.monitor' doesn't exist 2026-06-15T02:23:36Z [DB] ERROR: Database migration failed 2026-06-15T02:23:36Z [SERVER] ERROR: Failed to prepare your database: alter table `monitor` add `ws_ignore_sec_websocket_accept_header` boolean not null default '0', add `ws_subprotocol` varchar(255) not null default '' - Table 'kuma.monitor' doesn't exist ```
0 条评论