Let MySQL users create databases, but allow access to only their own databases

后端 未结 4 1503
一向
一向 2020-11-29 23:09

I want to have multiple a MySQL users to be able to issue commands like

CREATE DATABASE dbTest;

But I also want each of t

4条回答
  •  既然无缘
    2020-11-29 23:20

    You can use

    GRANT ALL PRIVILEGES ON `testuser_%` . * TO 'testuser'@'%';
    

    to grant the user testuser privileges on all databases with names beginning with testuser_.

    EDIT: I'm not sure if this user is now also allowed to create databases.

    Yes, this allows the testuser to create databases limited to names starting with testuser_

提交回复
热议问题