Allow user to create and alter table?

前端 未结 4 1045
你的背包
你的背包 2021-01-17 10:42

I have a current mysql user who has SELECT privileges for all the table in database example. How can give that user privileges to add new tables, a

相关标签:
4条回答
  • 2021-01-17 11:13

    GRANT SELECT, INSERT, DELETE ON database TO username@'localhost' IDENTIFIED BY 'password';

    You can use UPDATE in the list too.

    0 讨论(0)
  • 2021-01-17 11:14

    maybe something like

    GRANT ALL PRIVILEGES ON example . * TO 'user'@'%';

    This gives all the privileges for ONLY the 'example' database to user

    0 讨论(0)
  • 2021-01-17 11:21

    Use the grant keyword combined with the table privileges you seek to give the user.

    GRANT ALTER, CREATE ON example TO 'someuser'@'somehost';
    

    MySQL Grant

    MySQL Table Privileges

    0 讨论(0)
  • 2021-01-17 11:35

    Old; but just because it comes first when you query about "mysql grants to create table" GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, LOCK TABLES, SHOW VIEW ON database.* TO 'user'@'host'

    0 讨论(0)
提交回复
热议问题