1. MySQL Login
Mysql-u username-p
2. MySQL Create user
Use MySQL//enter MySQL table
INSERT into User (Host,user,password) VALUES ('% ', ' username ', Password (' Passwword ')); % indicates that any IP can be accessed directly by entering IP control login localhost for smart native login
3. User Rights Management
1) Set permissions
Grant all on Db_name.tb_name to ' username ' @ ' host '; All indicates that all permissions in the current database select represents the permissions of the query permission update Delete (multiple, separated by numbers) db_name refers to the name of the table to which the permission is granted, tb_name refers to the table name in the database * refers to all
2) Delete permissions
Revoke all on db_name.tb_name to ' username ' @ ' host '; If you do not have permission to delete an error
3) Delete user directly
DELETE from Mysql.user WHERE user= ' username ' and host= '% ';
Precautions:
Set the user, and give the user permissions to remember to refresh the permissions, flush privileges;
MySQL Beginner note ①--MySQL user login rights control