我对这个错误感到摸不着头脑。我试图通过 phpmyadmin 导入一个 sql 文件,它接连出现此错误,我无法解决任何问题。有人可以分析下面的行并让我知道他们是否发现任何错误吗?
谢谢
<小时/>--
-- Table structure for table `jos_address_members`
--
CREATE TABLE IF NOT EXISTS `jos_address_members` (
`uid` int(10) unsigned NOT NULL DEFAULT '0',
`adid` int(10) unsigned NOT NULL DEFAULT '0',
`publish` tinyint(4) NOT NULL DEFAULT '1',
`ordering` tinyint(3) unsigned NOT NULL DEFAULT '9',
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
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 ') ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' at line 12
最佳答案
删除DEFAULT '9'
后面的逗号
CREATE TABLE IF NOT EXISTS `jos_address_members` (
`uid` int(10) unsigned NOT NULL DEFAULT '0',
`adid` int(10) unsigned NOT NULL DEFAULT '0',
`publish` tinyint(4) NOT NULL DEFAULT '1',
`ordering` tinyint(3) unsigned NOT NULL DEFAULT '9'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
关于mysql - SQL 查询错误#1064,没有任何明显错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45050370/