How to limit databases number that a MySQL user can create? Is there any way to limit the number of databases, that a specific MySQL user can create? (as like as in any web hosting), they give each user the ability of creating specific number of databases.
A Limit to the number of MySQL Databases a User Account can Create

At the MySQL level as per the Limits on Number of Databases and Tables there is no limit on the number of databases MySQL can contain at this level.

If you give a user account the global CREATE permission to create new databases, then you give them just that and you cannot restrict the number of databases it can create at this level.

Limiting the number of Database a MySQL User Account can Create

To control the number of database you allow a user account to create you could just create the databases per an "approved" request and not grant them permission to CREATE databases themselves. You'd grant the user account Database Privileges at this level once created.

Additionally, as some third party hosting services utilize, if you only allow access to manage MySQL instances and databases via an application, it is possible to have rules at this level keeping track of the number of databases an account creates, and enforcing rules to set such restrictions.



Related Posts


Hosting: why does the number of MySQL databases matter?
Global Privileges
Database Privileges