Users play a vital role in a database. Generally, permissions are given to users by the database administrator. The database administrator gives access to the username and password. We can create different users to carry out different tasks. We can also give permissions to our users depending on our needs.
Before we create a user, we first need to connect to a system, and then create the user and grant permissions.
In the code above, we created a user and only gave the user permission for the session.
A user can only access the session of this database, and cannot perform operations like insert
, delete
, update
, etc., onto the database.
When one tries to perform any operations on the database, it throws an error.
We can create a user and give it permissions to all the resources of the database.
A user can then perform all operations, like insert
, delete
, update
, and select
.
The user can utilize everything in the database if we grant all the permissions.