We can also add user account by using GRANT SQL command. It can be illustrated by using the following example −
In this example, we will add user Zara with password zara123 for a particular database,
which is named as TUTORIALS.
root@host# mysql -u root -p password; Enter password:******* mysql> use mysql; Database changed mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP -> ON TUTORIALS.* -> TO 'zara'@'localhost' -> IDENTIFIED BY 'zara123';
The above statements will also create an entry in the MySQL database table called as a user.