2

I keep getting this error:

MySQL said: Documentation
#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 'USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=13' at line 11

with this with this query:

SQL query:

    CREATE TABLE IF NOT EXISTS `jml_usergroups` (
    `id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary Key',
    `parent_id` int( 10 ) unsigned NOT NULL DEFAULT '0' COMMENT 'Adjacency List Reference Id',
    `lft` int( 11 ) NOT NULL DEFAULT '0' COMMENT 'Nested set lft.',
    `rgt` int( 11 ) NOT NULL DEFAULT '0' COMMENT 'Nested set rgt.',
    `title` varchar( 100 ) NOT NULL DEFAULT '',
    PRIMARY KEY ( `id` ) ,
    UNIQUE KEY `idx_usergroup_parent_title_lookup` ( `parent_id` , `title` ) ,
    KEY `idx_usergroup_title_lookup` ( `title` ) ,
    KEY `idx_usergroup_adjacency_lookup` ( `parent_id` ) ,
    KEY `idx_usergroup_nested_set_lookup` ( `lft` , `rgt` ) USING BTREE
    ) ENGINE = MYISAM DEFAULT CHARSET = utf8 AUTO_INCREMENT =13;

Any idea what the problem is? these errors are like the thorns on a rose

1

1 Answer 1

2

The syntax is ok, your problem is probably that you're trying to run it on a MySQL version earlier than 5.1, which does not have USING BTREE.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks guys - it worked. all I did for future reference was opened up the .sql file and removed 'USING BTREE'
@CallumPirie Nothing to be sorry for, I had to look it up now too since I've never asked any questions :) Under the number to the left of the answer, there should be the outline of a checkbox. You should be able to click that to accept the answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.