laika222
11/9/2016 - 9:22 PM

Line 1 shows GRANT OPTION, which allows user to grant those privileges to another user. Line 6 shows how to REVOKE with CASCADE, which takes

Line 1 shows GRANT OPTION, which allows user to grant those privileges to another user. Line 6 shows how to REVOKE with CASCADE, which takes away privileges from user, as well as privileges that user has given to others with the GRANT OPTION. Line 10 shows how to REVOKE with RESTRICT, which only works if the user hasn't granted privileges to any other users. This allows you to determine what privileges have been shared, and allows you to avoid removing privileges from others without knowing that you're removing these privileges. REVOKE CASCADE and REVOKE RESTRICT apparently don't work in mysql.

GRANT UPDATE (CompanyID)
ON products1
TO Kirk
WITH GRANT OPTION;

REVOKE GRANT OPTION FOR (CompanyID)
ON products1
FROM Kirk CASCADE;

REVOKE GRANT OPTION FOR (CompanyID)
ON products1
FROM Kirk RESTRICT;