mysql版本是5.5.50-0ubuntu0.14.04.1,我的test.sql文件包含
-- Host: localhost Database: test
-- ------------------------------------------------------
-- Server version 5.7.18-0ubuntu0.16.04.1
CREATE TABLE `auth_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`password` varchar(128) NOT NULL,
`last_login` datetime(6) DEFAULT NULL,
`is_superuser` tinyint(1) NOT NULL,
..................................
当我尝试使用mysql -uroot -ppassword test<恢复数据时test.sql显示
ERROR 1064 (42000) at line 140: 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,`is_superuser` tinyint(1) NOT NULL,
`username` varchar(150' at line 4
由于单引号导致错误,或者可能是mysql版本差异。 请帮帮我
答案 0 :(得分:0)
DateTime没有大小尝试:
-- Host: localhost Database: test
-- ------------------------------------------------------
-- Server version 5.7.18-0ubuntu0.16.04.1
CREATE TABLE `auth_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`password` varchar(128) NOT NULL,
`last_login` datetime DEFAULT NULL,
`is_superuser` tinyint(1) NOT NULL,
..................................