Computer Science, asked by shardasomya8890, 1 year ago

How can we revoke privileges from a MySQL user?

Answers

Answered by siddartha32
0

Let’s examine the MySQL REVOKE statement in more detail.

First, specify a list of privileges that you want to revoke from a user right after the REVOKE keyword. You need to separate privileges by commas.

Second, specify the privilege level at which privileges is revoked in the ON clause .

Third, specify the user account that you want to revoke the privileges in the FROM clause.

Note that to revoke privileges from a user account, you must have GRANT OPTION privilege and the privileges that you are revoking.

To revoke all privileges from a user, you use the following form of the REVOKE statement:

1

REVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user]…

To execute the REVOKE ALL statement , you must have the global CREATE USER privilege or the UPDATE privilege for the mysql database.

To revoke proxy user, you use the REVOKE PROXY command as follows:

1

REVOKE PROXY ON user FROM user [, user]...

A proxy user is a valid user in MySQL who can impersonate another user, therefore, the proxy user has all privileges of the user that it impersonates.

Before revoking privileges of a user, it is good practice to check if the user has the privileges by using the SHOW GRANTS statement

When the MySQL REVOKE command takes effect

The effect of MySQL REVOKE statement depends on the privilege level as follows:

The changes that are made to the global privileges only take effect when the client connects to the MySQL in the subsequent sessions. The changes are not applied to all currently connected users.

The changes of the database privileges are applied after the next USE statement.

The changes of table and column privilege are applied to all queries issued after the changes were made.

In this tutorial, you’ve learned how to use the MySQL REVOKE statement to revoke privileges from MySQL users.

please mark this answer as brainliest answer

Similar questions