我需要在我的服务器上运行这些MySQL查询,但是我收到错误
“您的SQL语法有错误;请查看与您的MySQL服务器版本对应的手册,以便在'USING BTREE'附近使用正确的语法
以下是查询:
"CREATE INDEX pphpbb_forums_track_forum_id
ON phpbb_forums_track
USING btree
(forum_id);
CREATE INDEX pphpbb_forums_track_user_id
ON phpbb_forums_track
USING btree
(user_id);
CREATE INDEX phpbb_topics_track_user_id
ON phpbb_topics_track
USING btree
(user_id);
“
答案 0 :(得分:2)
快速浏览http://dev.mysql.com/doc/refman/5.0/en/create-index.html 告诉我你用Using交换了(user_id)。
CREATE INDEX phpbb_topics_track_user_id
ON phpbb_topics_track (user_id)
USING btree;
答案 1 :(得分:2)
CREATE INDEX语法
CREATE [UNIQUE|FULLTEXT|SPATIAL] INDEX index_name
[index_type]
ON tbl_name (index_col_name,...)
[index_type]
所以你的查询应该是
CREATE INDEX pphpbb_forums_track_forum_id
ON phpbb_forums_track (forum_id)
USING btree;
CREATE INDEX pphpbb_forums_track_user_id
ON phpbb_forums_track (user_id)
USING btree ;