I'm fairly new to MySQL and I've been creating test tables, etc.
Anyway, I created a new user, using
CREATE USER 'myUser'@'localhost' IDENTIFIED BY 'myPassword';
Now, when I log into this user, I can SELECT
from a table I created with root earlier. Surely this should not be possible? The user has no SELECT
permissions, or indeed any permissions. If (logged in as root) I do either:
SHOW GRANTS FOR 'myUser'@'localhost';
Or
SELECT * FROM information_schema.user_privileges WHERE grantee LIKE "'myUser'@%";
I can see they only have USAGE permissions. My understanding is this permission is set to indicate a user has no permissions.
So how is this user able to SELECT from my table?
If I do:
SELECT * FROM information_schema.table_privileges;
No results are returned.
What am I missing here? Are certain things like SELECT
implicitly granted to new users? Do I have to explicitly revoke this?
If so, what other permissions are implicitly granted?
Ideally what I'm aiming for is a user that can do nothing except run one (or more) stored procedures that I specify with GRANT EXECUTE ON
.