安装成功后发帖报错:
(1146) Table ‘discuz.forum_post’ doesn’t exist
SELECT * FROM forum_post WHERE authorid=‘2’ AND invisible=’-3’ AND first=‘1’ LIMIT 20

后来一查原来是pre_forum_post 建表失败了.报错如下:
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘TYPE=MyISAM’ at line 36
大致意思就是语法问题不支持TYPE=MyISAM
然后我有改成ENGINE=MyISAM,还是报错,不过这次报错不一样了,错误信息如下:
[Err] 1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key
表定义不正确;只能有一个auto列,必须将其定义为键
pre_forum_post 原表结构:
CREATE TABLE pre_forum_post (
pid int(10) unsigned NOT NULL,
fid mediumint(8) unsigned NOT NULL DEFAULT '0',
tid mediumint(8) unsigned NOT NULL DEFAULT '0',
`first` tinyint(1) NOT NULL DEFAULT '0',
author varchar(15) NOT NULL DEFAULT '',
authorid mediumint(8) unsigned NOT NULL DEFAULT '0',
`subject` varchar(80) NOT NULL DEFAULT '',
dateline int(10) unsigned NOT NULL DEFAULT '0',
message mediumtext NOT NULL,
useip varchar(15) NOT NULL DEFAULT '',
`port` smallint(6) unsigned NOT NULL DEFAULT '0',
invisible tinyint(1) NOT NULL DEFAULT '0',
anonymous tinyint(1) NOT NULL DEFAULT '0',
usesig tinyint(1) NOT NULL DEFAULT '0',
htmlon tinyint

本文解决MySQL中因语法错误导致的建表失败问题,通过调整表结构和引擎设置,成功创建pre_forum_post和pre_common_member_grouppm表。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



