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 operation to 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
Steps to create a new user:
1, go to MySQL database
MySQL> use mysqlDatabase changed
2, new users to increase the deletion
1. Create User: # Specify IP:192.118.1. 1 MJJ User LoginCreate User 'MJJ'@'192.118.1.1'Identified by '123'; # Specify IP:192.118.1. Beginning of MJJ User loginCreate User 'MJJ'@'192.118.1.%'Identified by '123'; # Specify MJJ user login for any IPCreate Use 'MJJ'@'%'Identified by '123';2. Deleting usersDrop User 'User name'@'IP Address';3. Modify User RenameUser 'User name'@'IP Address' to 'New user name'@'IP Address';4. Change PasswordSetPassword for 'User name'@'IP Address'=Password ('New Password');
For current user authorization management:
#查看权限show Grants for 'User'@'IP Address'#授权Grant Select,Insert,Update onDb1.t1 to"MJJ" @'%', # Indicates a certain permission, except for Grant, which is the root of the command. Grant All Privileges onDb1.t1 to"MJJ" @'%'; #取消权限取消来自远程服务器的mjj用户对数据库db1的所有表的所有权限Revoke All onDB1.* from 'MJJ'@"%"; Remove all tables from the remote server's MJJ user for all databasesRevoke All Privileges on '*' from 'MJJ'@'%';
MySQL backup command line operation:
# Backup: Data table structure+Data Mysqdump-U root DB1>Db1.sql-p# Backup: Data table structure Mysqdump-U root-D DB1>Db1.sql-p# Importing existing data to a database #1. Create a new database firstCreate Databasedb10;#2. Import the existing database files into the DB10 database Mysqdump-U root-D DB10<Db1.sql-P
MySQL Create user and authorization