收藏文章 楼主

小绿叶数据库表结构 HS 社区软件更新后 报错:Unknown column 'lastedituid' in 'field list'

版块:任务   类型:普通   作者:小绿叶技术博客   查看:1774   回复:0   获赞:0   时间:2022-01-14 08:26:21

表结构:读取,替换,授权


HS 社区软件更新后,数据库表 pk_read 加了两个字段 lastedituid 和  lastedittime  为 int 类型 长度 11,默认值为空 null

通过 phpmyadmin 登录数据库,导出新软件的 数据库表结构,然后记事本打开,发现多出字段:
`lastedituid` int(11) NOT NULL DEFAULT '0',
`lastedittime` int(11) NOT NULL DEFAULT '0',
`lastedituid` int(11) NOT NULL DEFAULT '0',

`image` text DEFAULT NULL COMMENT '文章图片',
`video` text DEFAULT NULL COMMENT '文章视频',
`audio` text DEFAULT NULL COMMENT '文章音频'

处理方案:更新表结构,在列   label 后面新增三个字段:  lastedituid    lastedittime     lastedituid   类型int长度为 11
方法:
通过 phpmyadmin 登录数据库,点击sql 执行下面语句:
ALTER TABLE `pk_read` ADD `lastedittime` INT(11) NULL DEFAULT NULL AFTER `label`, ADD `lastedituid` INT(11) NULL DEFAULT NULL AFTER `lastedittime`, ADD `lookonlyme` INT(11) NULL DEFAULT NULL AFTER `lastedituid`;
ALTER TABLE `pk_read` ADD   `image` text DEFAULT NULL COMMENT '文章图片', ADD    `video` text DEFAULT NULL COMMENT '文章视频',  ADD   `audio` text DEFAULT NULL COMMENT '文章音频' 


# 说明: ALTER TABLE  是更新表结构命令, ADD 是增加表结构的字段 



  1.   读取


CREATE TABLE `pk_read` (

 `id` int(11) NOT NULL AUTO_INCREMENT,

 `sortid` int(11) NOT NULL DEFAULT '0',

 `label` text COMMENT '标签',

 `uid` int(11) NOT NULL,

 `title` text CHARACTER SET utf8mb4 NOT NULL,

 `content` longtext CHARACTER SET utf8mb4 NOT NULL,

 `looknum` int(11) NOT NULL DEFAULT '0',

 `zannum` int(11) NOT NULL DEFAULT '0',

 `posttime` int(11) NOT NULL,

 `postip` varchar(255) DEFAULT NULL COMMENT '发布人的ip',

 `readlevel` int(11) NOT NULL DEFAULT '0',

 `replyuid` int(11) unsigned NOT NULL DEFAULT '3',

 `replycontent` text CHARACTER SET utf8mb4,

 `replytime` int(11) unsigned NOT NULL DEFAULT '0',

 `replyip` varchar(255) DEFAULT NULL COMMENT '最后回复人的ip',

 `top` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '文章置顶',

 `high` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '文章精华',

 `locked` tinyint(3) NOT NULL DEFAULT '0',

 `replyafterlook` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '回复后可见',

 `data` longtext COMMENT '文章其他数据',

 `del` tinyint(1) NOT NULL DEFAULT '0',

 `fs` int(11) DEFAULT '1',

 `activetime` int(11) NOT NULL DEFAULT '0',

 `replyid` int(11) NOT NULL DEFAULT '0',

 `apptype` varchar(255) DEFAULT NULL,

 `jvhuo_gid` int(11) NOT NULL DEFAULT '0' COMMENT '聚货网相关联商品id',

 `lastedituid` int(11) NOT NULL DEFAULT '0',

 `lastedittime` int(11) NOT NULL DEFAULT '0',

 PRIMARY KEY (`id`),

 KEY `sortid` (`sortid`),

 KEY `del` (`del`),

 KEY `uid` (`uid`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8



  1.   替换

CREATE TABLE `pk_reply` (

 `id` int(11) NOT NULL AUTO_INCREMENT,

 `rid` int(11) NOT NULL,

 `uid` int(11) NOT NULL,

 `content` text CHARACTER SET utf8mb4 NOT NULL,

 `posttime` int(11) NOT NULL,

 `postip` varchar(255) DEFAULT NULL COMMENT '发布人的ip',

 `zannum` int(11) NOT NULL DEFAULT '0',

 `top` tinyint(3) NOT NULL DEFAULT '0',

 `del` tinyint(1) NOT NULL DEFAULT '0',

 `fnum` int(11) DEFAULT '0',

 `data` longtext,

 PRIMARY KEY (`id`),

 KEY `rid` (`rid`),

 KEY `uid` (`uid`),

 KEY `del` (`del`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8


  1.   用户

grant select,insert,update,delete on *.* to "test1"@"%" Identified by "abc";


update user set password=password('123456') where user='root' and host='127.0.0.1';




提供企业建站服务,免费网防系统,提交信息登录 http://yundun.ddoss.cn 邮箱: proposal@ddoss.cn 
回复列表
默认   热门   正序   倒序

回复:小绿叶数据库表结构 HS 社区软件更新后 报错:Unknown column 'lastedituid' in 'field list'

头像

用户名:

粉丝数:

签名:

资料 关注 好友 消息