0

I would like to create a column in a table, with data type BLOB and attribute BINARY, however, MySQL always says that there is a syntax error in my code, I cannot see any.

My code is:

ALTER TABLE `Users` CHANGE `user_image` `user_image` BLOB BINARY NULL DEFAULT NULL;

And the error message is:

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 'BINARY NULL DEFAULT NULL' at line 1.

1 Answer 1

0

Modify existing column

ALTER TABLE table_name
MODIFY COLUMN column_name datatype;

Add a new column

ALTER TABLE table_name
ADD column_name datatype;
Sign up to request clarification or add additional context in comments.

2 Comments

It doesn't work...I got the same error again. It seems that the BINARY attribute caused the problem, because every time the error message says "check the manual that corresponds to your MySQL server version for the right syntax to use near 'BINARY NULL DEFAULT NULL' at line 1."
datatype should be either blob or binary, stackoverflow.com/questions/7421933/…

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.