开发者

Why this is not valid MySQL query?

开发者 https://www.devze.com 2022-12-19 18:18 出处:网络
mysql> ALTER TABLE bdds_arts ADD test VARBINARY; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
mysql> ALTER TABLE bdds_arts ADD test VARBINARY;

ERROR 1064 (42000): 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 
'' at line开发者_C百科 1

something wrong with varbinary type?

here is output of mysql --version

mysql  Ver 14.12 Distrib 5.0.24a, for Win32 (ia32)

UPDATE If I change VARBINARY for BINARY or, say, VARBINARY(25) it works.

Since this is piece of auto-generated script in order to fix this I should know what is going on.


The BINARY and VARBINARY types are similar to CHAR and VARCHAR.

You have to use a length for it like Varchar(255)


Remove the comma after bdds_arts.

0

精彩评论

暂无评论...
验证码 换一张
取 消