MySQL create users and set all permissions

1, create a user: CREATE USER 'username' @ 'host' IDENTIFIED BY 'password';

username: User name;

host: Specifies which may be registered in the host machine can be set localhost,% pass with all remote hosts;

password: user login password;

2、授权:GRANT ALL PRIVILEGES ON  *.* TO ‘username’@‘%’ IDENTIFIED BY 'password’;

Format: grant permission on the name of the database table name to log in the user @ host identified by "user password";

* * On behalf of ownership;

Access is behind @ MySQL client IP address (or host name)% on behalf of any client, if fill in localhost for the local access (that the user can not remotely access the mysql database a).

3, the refresh permissions: FLUSH PRIVILEGES;

Published 109 original articles · won praise 101 · views 360 000 +

Guess you like

Origin blog.csdn.net/Alen_xiaoxin/article/details/105092704