NekoWheel / NekoBox

📫 匿名提问箱 / Anonymous question box
https://box.n3ko.cc
MIT License
208 stars 28 forks source link

提示少了一个表,是哪里忘记配置了吗 #25

Closed hdm9527 closed 1 year ago

hdm9527 commented 1 year ago

image 配置文件 image 数据库 image

wuhan005 commented 1 year ago

这是 Flamego Session 中间件的一个老问题了。 在使用 MySQL 数据库存储 Session 时不会自动创建表,需要手动执行如下语句创建:

CREATE TABLE `sessions` (
  `key` varchar(255) NOT NULL,
  `data` blob NOT NULL,
  `expired_at` datetime NOT NULL,
  PRIMARY KEY (`key`)
)
wuhan005 commented 1 year ago

不过现在已经支持存储 Session 至 Redis 了,目前线上也是这样做的。

hdm9527 commented 1 year ago

不过现在已经支持存储 Session 至 Redis 了,目前线上也是这样做的。

我先跑起来看看,有装Redis

hdm9527 commented 1 year ago

这是 Flamego Session 中间件的一个老问题了。 在使用 MySQL 数据库存储 Session 时不会自动创建表,需要手动执行如下语句创建:

CREATE TABLE `sessions` (
  `key` varchar(255) NOT NULL,
  `data` blob NOT NULL,
  `expired_at` datetime NOT NULL,
  PRIMARY KEY (`key`)
)

跑起来了,谢谢