The create user 'username' @ 'host' identified by 'password'.
Example: the create user xiaogang identified by '123456'.
Host: specify that the user can log in, on which host if it is local users can use localhost, if you want the user to login from any remote host, you can use the wildcard %
2. Delete the user
Drop the user '@';
3. The authorization format: grant permissions on the database. * to login user name @ host identified by "password"
Grant privileges on databasesname. Tablename to 'username' @ 'host';
Privileges: user operation privileges, such as select, insert, update all use all
For example, grant the select, insert, update, delete, create, drop on VTDC. The employee to [email protected] identified by '123');
Note:
Using the above command can't give other users authorized authorized users, if you want to let the user may authorize, use the following command:
Grant privileges on databasesname. Tablename to 'username' @ 'host' with grant option;
4. Set up and change user password
Set the password for the 'username' @ 'host'=password (' newpassword);
5. Revocation of user permissions formats: revoke permissions on the database. Data sheets from 'users' @' hostname ';
Revoke privileges on databasesname, tablename from 'username' @ 'host';
For example, revoke all on *. * from 'xiaogang' @ '%';
6. Refresh the mysql privileges
flush privileges;
CodePudding user response:
What points?CodePudding user response:
the original poster notes do well, but it is better to write blog,CodePudding user response:
Thanks for sharing ~ ~CodePudding user response:
Support,,,,CodePudding user response:
Thumb up notes, thanks for sharingCodePudding user response:
CodePudding user response:
Should go to a blog notes