mysql-Backup and Recovery

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.