MySQL user 想要 RENAME Table 需要開哪些權限呢?
MySQL RENAME Table 需要開哪些權限
- 原始 Table 需要有 ALTER 和 DROP 的權限
- 新的 Table 需要有 CREATE 和 INSERT 的權限
語法如下:
- GRANT INSERT,DROP,CREATE,ALTER ON *.* TO 'user'@'%' IDENTIFIED BY 'password';
- GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON *.* TO 'user'@'%' IDENTIFIED BY 'password'; #
新刪改查一般權限都加進去 - FLUSH PRIVILEGES;
相關網頁
- MySQL 5.6 Reference Manual :: 13.1.32 RENAME TABLE Syntax
- You must also have the ALTER and DROP privileges on the original table, and the CREATE and INSERT privileges on the new table.
- MySQL 5.6 Reference Manual :: 6.2.1 Privileges Provided by MySQL