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

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

    It is impossible to do this using permissions only .

    The workaround as suggested in another answer: GRANT ALL PRIVILEGES ONtestuser_%. * TO 'testuser'@'%'; has the problem that the users must then be very careful in naming their databases.

    For example if user aaa creates database bbb_xyz, it can then be accessed exclusively by user bbb but not by user aaa.

提交回复
热议问题