I am trying to add a column to an existing table in mysql.
I am trying to do this:
ALTER TABLE users ADD online TINYTEXT(3) AFTER name;
But it causes this error:
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 '(3) AFTER name' at line 1
答案 0 :(得分:1)
ALTER TABLE `users` ADD `online` TINYTEXT AFTER `name`;
答案 1 :(得分:1)
删除(3)
。 Tinytext既不需要也不支持。如果您只想要3个字符,请不要使用tinytext,请使用char或varchar。