MySQL backup-Import and Export

Source: Internet
Author: User
Tags mysql backup

Assume that MySQL is installed on the C: disk, the MySQL database username is root, the password is root, the database name is Alfresco, And the backup database is stored under the D: disk root directory, the backup database name is alfresco_20070713. SQL (20070713. SQL indicates the backup date)

Back up the database:

Mysqldump-u root-proot alfresco> D:/alfrescobackup/mysqlbackup/alfresco_20130301. SQL

Restore database:

Delete the original database, create a database, import the backup database, log on to the MySQL console, and execute the following script:

Source c: \ Users \ psun \ Desktop \ alfresco backup \ mysqlbackup \ alfresco_2013_03_01. SQL

Note: before importing a backup database, if database_name does not exist, you need to create it. It must be the same as the database name in backup20070713. SQL to import the database.

Note: Windows Command Line

 
@ Echo offif not exist "D:/alfrescobackup/mysqlbackup/" (MD "D:/alfrescobackup/mysqlbackup/") cd c: /program files/MySQL Server 5.5/binmysqldump-u root-proot alfresco> D:/alfrescobackup/mysqlbackup/alfrescodb _ % Date :~, 4% % Date :~ 5, 2% % Date :~ 8, 2%. SQL

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.