今天安装tikiwiki,发现有个功能不能安装

Command:
  CREATE TABLE tiki_articles (
  articleId int(8) NOT NULL auto_increment,
  topline varchar(255) default NULL,
  title varchar(80) default NULL,
  subtitle varchar(255) default NULL,
  linkto varchar(255) default NULL,
  lang varchar(16) default NULL,
  state char(1) default ’s’,
  authorName varchar(60) default NULL,
  topicId int(14) default NULL,
  topicName varchar(40) default NULL,
  size int(12) default NULL,
  useImage char(1) default NULL,
  image_name varchar(80) default NULL,
  image_caption text default NULL,
  image_type varchar(80) default NULL,
  image_size int(14) default NULL,
  image_x int(4) default NULL,
  image_y int(4) default NULL,
  image_data longblob,
  publishDate int(14) default NULL,
  expireDate int(14) default NULL,
  created int(14) default NULL,
  heading text,
  body text,
  hash varchar(32) default NULL,
  author varchar(200) default NULL,
  reads int(14) default NULL,
  votes int(8) default NULL,
  points int(14) default NULL,
  type varchar(50) default NULL,
  rating decimal(3,2) default NULL,
  isfloat char(1) default NULL,
  PRIMARY KEY  (articleId),
  KEY title (title),
  KEY heading (heading(255)),
  KEY body (body(255)),
  KEY reads (reads),
  KEY author (author(32)),
  FULLTEXT KEY ft (title,heading,body)
)
TYPE=MyISAM AUTO_INCREMENT=1

Message: 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 ‘reads int(14) default NULL,
  votes int(8) default NULL,
  points int(14) default’ at line 28

———————————–

在google搜索,找不到答案。再看它的错误提示:your MySQL server version for the right syntax to use 。我的MySQL版本是5.0.15。会不会是版本太高?查找5.0的MySQL文档发现:字段reads 居然是保护词组(reserved-words),见http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html。晕倒!

所以设计数据库应注意自己命名的table或字段是否跟mysql冲突,以免出现莫名其妙的错误。


1条评论

发表评论

评论也有版权!