0

Is there a way to create a user in MySQL that have login access but no databases, but it allows the user to create a new database to a limit of 5 or what ever I decide.

So basically what I want is to give a user access to create his own databases, but I dont want him to see other databases, also he should be limited to create only 5 databases

Donald Jansen
  • 1,937
  • 4
  • 22
  • 41
  • 1
    "*to give a user access to create his own databases*" - by granting the "create database" privilege? https://dev.mysql.com/doc/refman/5.5/en/privileges-provided.html#priv_create but I don't think you can limit that to only 5 databases. –  Jul 31 '14 at 08:56
  • Ok, ill go another route, will create a managment console might be easier (something like cpanel) – Donald Jansen Jul 31 '14 at 09:01
  • The scenario you are asking is exactly the one maintained by hosting providers creating a user and adding priveleges as in cpanel might help – NaveenThally Jul 31 '14 at 10:03

1 Answers1

1

There is no notion of "Database Owner" or "Database Creator" in MySQL, therefore there is no way to limit the number of databases created by a user.

Note: it is possible to put some restrictions at account-level, but not the ones you are looking for. You will need a third-party management tool for this.

Community
  • 1
  • 1
RandomSeed
  • 29,301
  • 6
  • 52
  • 87