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

后端 未结 4 1500
一向
一向 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:26

    You can use

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

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

    This allows the testuser to create databases limited to names starting with testuser_

提交回复
热议问题