Reload Privileges
After granting privileges, we need to reload the privileges for the changes to take effect. we have to enter the following command each time we run a command on the MariaDB server.
FLUSH PRIVILEGES;
Once we have completed this step, we can verify the new user has the right permissions by using the following statement:
SHOW GRANTS FOR 'username'@localhost;
Example: Let’s check the grants for minal user.
SHOW GRANTS FOR 'minal'@localhost;
Output:
Explanation: we can see below that the select and insert permission is only granted for user minal.
How to Create User With Grant Privileges in MariaDB
In database management, effective user management and privilege assignment are important for secure and efficient operations. MariaDB, a popular open-source relational database management system, offers robust features for managing users and their access rights.
In this article, we will understand how to create users and grant privileges to them in MariaDB with the help of various examples.