当我在本地主机上运行时,我有一些查询可以100%运行,但是当我尝试远程运行时,它们会给我语法错误。
以下是其中一个查询:
CREATE TABLE IF NOT EXISTS `customer` (
`id` int(11) NOT NULL,
`phone` text,
`date_modified` datetime(6) DEFAULT NULL,
`first_name` text,
`customer_id` int(11) DEFAULT NULL,
`store_credit` text,
`registration_ip_address` text,
`last_name` text,
`tax_exempt_category` text,
`date_created` datetime(6) DEFAULT NULL,
`email` text,
`notes` text,
`company` text,
`customer_group_id` int(11) DEFAULT NULL
)
这是错误:
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 '(6) DEFAULT NULL, `first_name` text, `customer_id` int(11) DEFAULT NULL,' at line 4
奇怪的是,它是完全相同的查询!我尝试在两种不同的托管服务上远程运行,它们都给我相同的语法错误。
我不知道如何解决它。任何人都知道可能是什么?
答案 0 :(得分:4)
我认为你的Mysql版本较低。你能执行并看到。
CREATE TABLE IF NOT EXISTS `customer` (
`id` int(11) NOT NULL,
`phone` text,
`date_modified` datetime DEFAULT NULL,
`first_name` text,
`customer_id` int(11) DEFAULT NULL,
`store_credit` text,
`registration_ip_address` text,
`last_name` text,
`tax_exempt_category` text,
`date_created` datetime DEFAULT NULL,
`email` text,
`notes` text,
`company` text,
`customer_group_id` int(11) DEFAULT NULL
)
谢谢。