Rights Management
We know that our top authority manager is the root user, and it has the highest permissions. Includes select, Update, delete, update, Grant, and so on. So in general, after the company, the DBA engineer creates a user and password that allows you to connect to the database and set permissions (or all permissions) for an operationto the current user. Then we need to take a brief look at this:
- How to create a user and password
- Authorizing the current user
- Remove permissions from the current user
If you want to create a new user, the following actions are required:
1. Go to MySQL Database
mysql> use mysqldatabase changed
2. New User deletion
1. Create User:#Specify MJJ User login for ip:192.118.1.1Create user'MJJ'@'192.118.1.1'Identified by'123';#specify ip:192.118.1. MJJ user Login at the beginningCreate user'MJJ'@'192.118.1.%'Identified by'123';#Specify MJJ User login for any IPCreate use'MJJ'@'%'Identified by'123';2. Delete User drop users'User name'@'IP Address';3. Modify user Rename users'User name'@'IP Address'To'New user name'@'IP Address';4. Modify password Set password from 'User name'@'IP Address'=password ('New Password');
3. Management of Current user authorization
#View PermissionsShow grants for 'User'@'IP Address'#AuthorizedGrant SELECT, Insert,update on Db1.t1 to"MJJ"@'%';#indicates the permission, except for Grant, which is the root of the command. Grant all privileges the DB1.T1 to"MJJ"@'%';#Cancel PermissionsRevoke all privileges fromDb1.t1 to'MJJ'@'%';
PS: In a company, it is generally the DBA engineer to do the authorization work. Give you a username and password, you can connect on it.
14-Supplemental content: MySQL create user and authorization