1. Log in to MySQL statement
Mysql-h hostname|hostip-p port-u username-p databasename-e "SQL statement";
2. Create a new normal user
CREATE USER [email protected] identified by ' password ';
INSERT into Mysql.user (Host,user,password) VALUES (' hostname ', ' username ', Password (' Password '));
GRANT Priv_type on database.table to [e-mail protected] identified by ' password ';
After the completion of the implementation of FULSH privileges, otherwise it will not take effect;
3. Delete a normal user
DROP USER [email protected];
4.root user to modify their own password
>mysqladmin-u username-p Password New_password
>enter password:******
UPDATE mysql.user SET password=password (' New_password ') WHERE user= ' username ' and host= ' Host ';
SET Password=password (' New_password ');
5.root user modified password for normal user
UPDATE mysql.user SET password=password (' New_password ') WHERE user= ' username ' and host= ' Host ';
SET PASSWORD for [email Protected]=password (' new_password ');
6. Ordinary users to modify their own password
SET Password=password (' New_password ');
7.MySQL Permissions Table
MySQL User management