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 ‘int’ at line 1
我在数据库用户表user中加入了一列,列名为right,导致后面对该列进行修改,查询等操作时一直报错,后来才发现这个属于mysql里的关键字,直接对其进行操作不行。同理,DESC等关键字也有这个问题。
解决方法是把right用两个``给括起来即可。这个符号按键在Esc键下方。
example:
alter table user modify column `right` int(1) unsigned comment '管理员是0,普通用户是1';
修改成功。