Note: Please go MySql client operating
1. Create a user
CREATE USER 'username'@'host' IDENTIFIED BY 'password';
//例
CREATE USER 'user1'@'localhost' IDENTIFIED BY '_123455aA';
You need to create a username for the user name
The host for the specified user can log on which host, local can be localhost, remote server can be an IP address, on behalf of any host%
password for the user to set a password, you do not need to empty password
2, user authorization
GRANT privileges ON databasename.tablename TO 'username'@'host';
databasename is the database name, all databases use *
tablename is the table name, all databases use *
3, delete users
DROP USER 'username'@'host';
4, modify the user
RENAME USER 'username'@'host' to 'new username'@'new host';
5, change passwords
SET PASSWORD FOR 'username'@'host'=Password('new password');
~~~~~~~
Perfected
~~~~~~~