Remove Permissions for a MySQL User on Linux

by Ismail.EL
0 comment

Remove Permissions for a MySQL User on Linux

The REVOKE statement enables system administrators to revoke privileges from MySQL accounts.

Step 1: Login to MySQL :

To begin, sign into MySQL with the following command:

Enter the administrator password you set up during installation.

Step 2: View Grants for MySQL User :

if you want to know and check them you can use the following command to check the grants for TestUser :

Step 2: Revoke Permissions to MySQL User :

The basic syntax for revoking permissions is as follows:

REVOKE Permission_To_Revoke ON database.table FROM ‘user’@’localhost’;

To understand I offer you these examples :

Example 1: To grant TestUser the ability to drop tables in the specific database tutorials_space_db , use the DROP permission.

Example 2: To grant CREATE permissions for all databases * and all tables * to the user TestUser (we created in the previous tutorial) use the CREATE permission.

Example 3: To REVOKE CREATE USER to User ‘TestUser’ use the CREATE USER permission

Finnaly to finished reload all the privileges with the flush command!

Please Share this topic for the benefit of everyone..

Conclusion

IIn this post, i have explained Remove Permissions for a MySQL User on Linux.
If you have any questions or feedback, feel free to leave a comment.
As always, if you found this post useful, then click like and share it 🙂

19530cookie-checkRemove Permissions for a MySQL User on Linux

Related Posts

Leave a Comment