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