你好我试图通过phpmyadmin将数据库导入mysql但是出现了以下错误:
-- -- Database: `final` -- -- -------------------------------------------------------- -- -- Table structure for table `nqjr5_assets` -- CREATE TABLE `nqjr5_assets` ( `id` int(10) UNSIGNED NOT NULL COMMENT 'Primary Key', `parent_id` int(11) NOT NULL DEFAULT '0'COMMENT AS `Nested set parent.`, `lft` int(11) NOT NULL DEFAULT '0'COMMENT AS `Nested set lft.`, `rgt` int(11) NOT NULL DEFAULT '0'COMMENT AS `Nested set rgt.`, `level` int(10) UNSIGNED NOT NULL COMMENT 'The cached level in the nested tree.', `name` varchar(50) NOT NULL COMMENT 'The unique name for the asset.\n', `title` varchar(100) NOT NULL COMMENT 'The descriptive title for the asset.', `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 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 'AS `Nested set parent.`, `lft` int(11) NOT NULL DEFAULT '0'COMMENT AS `Nested ' at line 13
答案 0 :(得分:0)
你的语法错了。它应该是这样的
CREATE TABLE nqjr5_assets (
id int(10) UNSIGNED NOT NULL COMMENT 'Primary Key',
parent_id int(11) NOT NULL DEFAULT '0' COMMENT 'Nested set parent.',
lft int(11) NOT NULL DEFAULT '0'COMMENT 'Nested set lft.',
rgt int(11) NOT NULL DEFAULT '0'COMMENT 'Nested set rgt.',
level int(10) UNSIGNED NOT NULL COMMENT 'The cached level in the nested tree.',
name varchar(50) NOT NULL COMMENT 'The unique name for the asset.\n',
title varchar(100) NOT NULL COMMENT 'The descriptive title for the asset.',
rules varchar(5120) NOT NULL COMMENT 'JSON encoded access control.' )
ENGINE=InnoDB DEFAULT CHARSET=utf8;