You can have 2 different ways to add users: by using the grant statement or by directly manipulating the MySQL authorization table. The better approach is to use the GRANT statement because they are more concise and seem to have fewer errors.
Display the user's authorization using the show grants statement
You can view the authorization form directly, or you can use the show grants statement to view the authorization of a user, which is obviously easier to use with the show grants statement.
Syntax: Show grants for USER_NAME
To accommodate the rights granted to users of any host, MySQL supports specifying user_name values in the User@host format.
For example, the following statement shows the permissions of a user admin:
Mysql>show grants for Admin@localhost;
The result is a Grnat authorization statement that creates the user:
GRANT RELOAD, SHUTDOWN, PROCESS on *.* to ' admin ' @ ' localhost ' identified by PASSWORD ' 28e89ebc62d6e19a '
A password is a form of encryption.
Use the GRANT statement to create a user and authorize
Syntax for Grant statements
GRANT priv_type (columns)
On what
To user identified by "password"
With GRANT OPTION
To use this statement, you need to fill in the following sections:
priv_type the permissions assigned to the user.
Priv_type can specify any of the following:
All Privileges FILE RELOAD
ALTER INDEX SELECT
CREATE INSERT SHUTDOWN
DELETE PROCESS UPDATE
DROP REFERENCES USAGE