0

please advice whats the error in this statement, this statement was working fine before the last update for mysql

CREATE TABLE `users` (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
                      username VARCHAR(50),
                      password VARCHAR(500) NOT NULL,
                      full_name VARCHAR(50),
                      is_author BOOLEAN DEFAULT  ,
                      UNIQUE INDEX (username));

thanks in advance

1
  • 1
    Please include waht is the exactt error your getting Commented Oct 24, 2015 at 11:31

1 Answer 1

3

Remove DEFAULT or set to value:

CREATE TABLE `users` (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
                      username VARCHAR(50),
                      `password` VARCHAR(500) NOT NULL,
                      full_name VARCHAR(50),
                      is_author BOOLEAN,  -- here or DEFAULT true/false
                      UNIQUE INDEX (username));

Also qoute password because it is keyword.

SqlFiddleDemo

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.