database backup: mysqldump-Uuser_name -P password database_name>file_name. SQL database restore: ①: Create a database: ② restore: MySQL-Uuser_name -P password database_name< file_name. SQL (full path) Method II: Restore: Sourcefile_name. SLQ (full path) restores the database to the current database creation User: (Must be in root to create users) Law one:Create User 'user_name'@'localhost'Identified by 'Password'; Law II: Direct operation of the user tableInsert intoMysql.User(Host,User, Authentication_string,ssl_cipher,x509_issuer,x509_subject)Values('localhost','user_name', PASSWORD ('Password'),"',"',"'); Must flush after operationPrivilegesDelete User: Law one:Drop User 'user_name'@'localhost'; Law II: Direct operation of the user tableDelete fromMysql.User whereHost='localhost' and User='user_name'; Must flush after deletionPrivileges(Refresh permissions) Modify user password: Mysqladmin-Uuser_name -pold_password password New_password; Law II: To log in to the user firstSetPassword=New_password; When the root user logs on, third: Log in to the root user, directly manipulate the authentication field in the user table to change the passwordUpdateMysql.User SetAuthentication_string=PASSWORD ('Password')whereHost='localhost' and User='user_name'; Law IV: Ordinary users log on to the current user, modify the currentSetPassword=Password'New_password'); SetPassword for 'user_name'@'localhost'=Password'New_password'); Refresh: FlushPrivileges;(directly manipulate the user table flushPrivilegesEach user profile is a record in the Users table
mysql-Backup and Recovery