开发者

mysql permissions needed to do a ALTER TABLE in database

开发者 https://www.devze.com 2023-01-13 13:59 出处:网络
grant LOCK TABLES, SELECT,ALTER,INSERT,CREATE ON `databasetoupgrade%`.* to \'someuser\'@\'localhost\';
grant LOCK TABLES, SELECT,ALTER,INSERT,CREATE ON `databasetoupgrade%`.* to 'someuser'@'localhost';

those are the privileges I gave a users that needs to be able to ALTER a table (add columns, ...)

the mysql documentation states that alter, insert, create is needed, but even with lock tables and select permissions, I still get the error that the user does not have enough permissions to do ALTER.

When I give the user all privileges on those tables/da开发者_如何学Pythontabases is works.

Does anyone know what the EXACT privileges are that I need to do ALTER? Of which one did I forget in the list above?

This post can be closed, this fixed it:

grant ALTER, LOCK TABLES, SELECT, INSERT, CREATE

I might have screwed up somewhere in my previous commands...


These grants now work fine (for backups) + ALTER command:

grant ALTER, LOCK TABLES, SELECT, INSERT, CREATE

0

精彩评论

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