这个MySQL语法有什么错误?
这里怎么了 我从本地pma导出此表,并尝试将其上载到远程服务器这个MySQL语法有什么错误?,mysql,sql,Mysql,Sql,这里怎么了 我从本地pma导出此表,并尝试将其上载到远程服务器 CREATE TABLE IF NOT EXISTS `posts` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `banna` text COLLATE utf8_croatian_ci, `bannb` text COLLATE utf8_croatian_ci,
CREATE TABLE IF NOT EXISTS `posts` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`banna` text COLLATE utf8_croatian_ci,
`bannb` text COLLATE utf8_croatian_ci,
`img` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`images` text COLLATE utf8_croatian_ci,
`title` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`subtitle` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`story` mediumtext COLLATE utf8_croatian_ci,
`status` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`tags` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`auth` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`moder` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`linked` json DEFAULT NULL,
`inde` int(11) DEFAULT NULL,
`count` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=382 DEFAULT CHARSET=utf8 COLLATE=utf8_croatian_ci
错误:
#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 'json DEFAULT NULL,
`inde` int(11) DEFAULT NULL,
`count` int(11) DEFAULT NULL' at line 15
我已经在mysql版本5.7.21上运行了您的查询,它工作正常,没有抛出错误,所以在我看来您的站点中出现了与mysql版本相关的问题,下面是执行结果
CREATE TABLE IF NOT EXISTS `posts` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`banna` text COLLATE utf8_croatian_ci,
`bannb` text COLLATE utf8_croatian_ci,
`img` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`images` text COLLATE utf8_croatian_ci,
`title` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`subtitle` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`story` mediumtext COLLATE utf8_croatian_ci,
`status` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`tags` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`auth` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`moder` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`linked` json DEFAULT NULL,
`inde` int(11) DEFAULT NULL,
`count` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
AUTO_INCREMENT = 382
DEFAULT CHARSET = utf8
COLLATE = utf8_croatian_ci
0行影响1.535秒我已经在mysql版本5.7.21上运行了您的查询,它工作正常,没有抛出错误,因此在我看来,您的站点中出现了与mysql版本相关的问题,下面是执行结果
CREATE TABLE IF NOT EXISTS `posts` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`banna` text COLLATE utf8_croatian_ci,
`bannb` text COLLATE utf8_croatian_ci,
`img` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`images` text COLLATE utf8_croatian_ci,
`title` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`subtitle` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`story` mediumtext COLLATE utf8_croatian_ci,
`status` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`tags` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`auth` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`moder` varchar(255) COLLATE utf8_croatian_ci DEFAULT NULL,
`linked` json DEFAULT NULL,
`inde` int(11) DEFAULT NULL,
`count` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
AUTO_INCREMENT = 382
DEFAULT CHARSET = utf8
COLLATE = utf8_croatian_ci
0行受影响1.535秒似乎mysql不支持
json
类型,请检查mysql版本您使用的mysql版本是什么json
数据类型仅在5.7+版本中可用。谢谢,问题似乎是mysql版本太低。非常感谢。似乎mysql不支持json
type,请检查mysql版本您使用的是哪个版本的mysqljson
数据类型仅在5.7+版本中可用。谢谢,问题似乎是mysql版本太低。谢谢。