1
CREATE TABLE  `auth_user` (

 `id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
 `password` VARCHAR( 128 ) COLLATE utf8_bin NOT NULL ,
 `last_login` DATETIME( 6 ) DEFAULT NULL ,
 `is_superuser` TINYINT( 1 ) NOT NULL ,
 `username` VARCHAR( 30 ) COLLATE utf8_bin NOT NULL ,
 `first_name` VARCHAR( 30 ) COLLATE utf8_bin NOT NULL ,
 `last_name` VARCHAR( 30 ) COLLATE utf8_bin NOT NULL ,
 `email` VARCHAR( 254 ) COLLATE utf8_bin NOT NULL ,
 `is_staff` TINYINT( 1 ) NOT NULL ,
 `is_active` TINYINT( 1 ) NOT NULL ,
 `date_joined` DATETIME( 6 ) NOT NULL ,
PRIMARY KEY (  `id` ) ,
UNIQUE KEY  `username` (  `username` )
) ENGINE = INNODB AUTO_INCREMENT =2 DEFAULT CHARSET = utf8 COLLATE = utf8_bin;

 *\#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,
`is_superuser` tinyint(1) NOT NULL,
`username` varchar(30)' at line 4*** 

This is the auth_user table from a django project. The SQL file was exported from my local MySQL database, but I can't import to the online mysql database. Could somebody can help me?

1 Answer 1

1

You do not need the length for datetime

`date_joined` DATETIME( 6 ) NOT NULL ,

should be

`date_joined` DATETIME  NOT NULL ,

https://dev.mysql.com/doc/refman/5.0/en/datetime.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.