问题描述
我的MySQL服务器上有奇怪的行为.我确定我拥有一个拥有所有特权的帐户.这是证明:
I have strange behavior on my MySQL server. I'm sure I have an account with all privileges. Here's the proof :
mysql> show grants;
+-------------------------------------------------------------------------+
| Grants for ***@localhost |
+-------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO '***'@'localhost' IDENTIFIED BY PASSWORD '***' |
| GRANT ALL PRIVILEGES ON `***`.* TO '***'@'localhost' |
| GRANT ALL PRIVILEGES ON `***`.* TO '***'@'localhost' |
| GRANT ALL PRIVILEGES ON `***`.* TO '***'@'localhost' |
+-------------------------------------------------------------------------+
4 rows in set (0.04 sec)
但是为什么我在执行这种语法时总是收到错误消息:
but why I always get error message when I'm executing this syntax :
mysql> ALTER TABLE outbox_multipart.ID AUTO_INCREMENT = 12;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 13924219
Current database: ***
ERROR 1142 (42000): ALTER command denied to user '***'@'localhost' for table 'ID'
我可以用该帐户执行几乎所有操作(INSERT,UPDATE,DELETE,TRUNCATE等),但可以进行更改.知道有什么问题吗?
I can do almost everything (INSERT, UPDATE, DELETE, TRUNCATE, etc) but ALTER with that account. any idea what's wrong with it?
我试图用phpmyadmin和php脚本做同样的事情,但是得到了相同的结果.看来我无法更改该列.
I tried to do same thing with phpmyadmin and php script, but got same result. seems that I can't ALTER that column.
推荐答案
用户'***'@'localhost'
对数据库'***'
具有所有特权,但是您试图更改另一个数据库outbox_multipart
中的表.向该数据库添加特权,重新连接并尝试更改.
User '***'@'localhost'
has all privileges on database '***'
, but you are trying to ALTER table in another database - outbox_multipart
. Add privileges to this database, re-connect and try to ALTER.
这篇关于错误1142(42000):ALTER命令被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!