User specific database without merging with root databases

Und alles was mit phpMyAdmin seine Verwandtschaft findet hat hier seinen Platz.

User specific database without merging with root databases

Postby optimisticwalker » 01. September 2018 21:57

Switched to XAMPP after a long time again.

MySql database created by the root user with Database-specific privileges for a sub-user won't allow the sub-user to create a new database from that sub account :( . Only table operations are allowed in this case.


On the other hand database created by the root user with Global privileges or both Global privileges & Database-specific privileges for a sub-user allows sub-user to create database from that sub-account.

The problem is that both the sub-user account and database created with such privileges are merged with root user account and is treated as root account with specific given privileges by the root user.


Is there a way to create MySql database from a sub-user's account that has been granted Database-specific privileges only by the root user?
optimisticwalker
 
Posts: 23
Joined: 01. September 2018 21:21
XAMPP version: 7.2.9
Operating System: WIndows

Re: User specific database without merging with root databas

Postby Altrea » 02. September 2018 20:16

:!: :?:
Creating databases is a global permission, so the user who should be able to create a database cannot have database specific permissions only.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: User specific database without merging with root databas

Postby Nobbie » 03. September 2018 11:02

The Data Model of MySQL does not know "sub-users". There are only users and priviledges. What are you quoting there?
Nobbie
 
Posts: 13165
Joined: 09. March 2008 13:04

Re: User specific database without merging with root databas

Postby optimisticwalker » 06. September 2018 20:17

In fact I started using root level database after a long time. Yes that's the truth that users with global privilege can't obtain user specific database rather they shall have access to all databases. However, I came up with granting database specific privilege for multiple databases to the desired single user or multiple users as I did long ago.

Thanks,
optimisticwalker
 
Posts: 23
Joined: 01. September 2018 21:21
XAMPP version: 7.2.9
Operating System: WIndows

Re: User specific database without merging with root databas

Postby Altrea » 06. September 2018 21:10

Altrea wrote::!: :?:
Creating databases is a global permission, so the user who should be able to create a database cannot have database specific permissions only.

I have learned something new today.

In fact it IS possible, to grant database specific permissions to a user INCLUDING creating databases.
Code: Select all
GRANT ALL PRIVILEGES ON `testuser\_%` .  * TO 'testuser'@'%';

This will grant the user the permission to create new databases starting with testuser_
If the user tries to create databases not starting with testuser_ it will get denied by error #1044.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64


Return to phpMyAdmin

Who is online

Users browsing this forum: No registered users and 25 guests