MYSQL - Permission to create database with prefix

I am trying to create a user who has permission to create databases, but only see the databases created by him self.

Someone said it wasn’t possible but gave me the suggestion to instead:

  1. Create a new user
  2. Give him the permission to only create databases that start with e.g. “Test_”
    ( GRANT ALL PRIVILEGES ON test_\_% . * TO ‘user’@‘%’; )

It seems to work, but in phpmyadmin “new” (add database icon) is missing, so maybe something is wrong?

Any suggestions?

In 99.9% of the cases it is a very bad idea to let a user create a database. Maybe you should tell us more about your global target and we can offer you a complete other solution?

1 Like

Thanks for your reply.

I see no problem with a user being able to freely create and manage databases (if they start with test_). It prevents him from accessing the other databases in the system.

The goal is to create a user who is able to manage databases that was created by himself, without affecting the security of the other databases in the system

There… is no icon for that in newer versions of PHPMyAdmin. Creating a database is done by going to the Databases tab and using the create box.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.