Database user management

07.21 self-summary

Database user management

A user to create a grammar

grammar:

create user username @ "ip address" "identified" by password;

For example:

create user tom@"192.168.101" identified by "123";

The first can create additional ip login other than the unit

create user username @ "%" "identified" by password;

II. Authorized users

1. give permission

grant all on *.* to toms@"%" identified by "123";

  • all: CRUD all permissions
  • all the way to the place where you can modify the updata, select waiting behind the select field can be expressed only view with a field
  • on the back of the library name, indicating that * means all
  • followed by the account number and account number to ip
  • If you create an account when there is no password can be added to create a password in the authorization here

2. withdraw permission

REVOKE all privileges [column] on 库名.表名 from user@"host";

column represents not fill all the fields

3. Delete user

drop user@"host"

4. refresh authority table

flush privileges;
refresh authority table for some time rights information may be a delay can execute the statement immediately refresh the authority information

Guess you like

Origin www.cnblogs.com/pythonywy/p/11221299.html