Comments - Grants from host % vs localhost
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
Separate users are not needed. Note however that some setups create anonymous users, which can cause failures to log in as expected from localhost. See Troubleshooting Connection Issues#localhost and %
Yes, separate users are still needed.
To simplify grants you can use a role and grant the role to both users. Then all database grants can be placed on the role and equally apply to the foo@% and foo@localhost users.
Hi,
It would be much easier if you could pass the links and provide an example what you would like to achieve, but let me see if I understood you correctly.
When you grant privileges to the user, you can specify to which user@host pair it should apply.
Let's look an example. Let's create 2 users and look the privs:
Now we can specify different privileges for them:
And let's verify they are different:
I guess this was what you are looking for?