How to back up and restore a MySQL database

Source: Internet
Author: User

MySQL Databases may sometimes encounter data faults. This requires us to back up the MySQL database and restore the database. The following describes how to back up the MySQL database for your reference.

1. ib_logfile0 and ib_logfile1 are the log files used by mysql to store operation execution, and are used for temporary transaction storage and rollback. When copying the ibdata1 data file to the new mysql, if the two log files are not copied, the startup will fail. In the. err File

InnoDB: Your database may be created upt or you may have copied the InnoDB

Log files cannot be identified

Perform the following operations to restore and restore the database:
Command Line startup:

1. Enter the bin directory mysqld-nt -- innodb_force_recovery = 4 // start data in read-only mode
Then leave the window empty.

2 MySQL Database Backup
Mysqldump-u **-p ** -- opt -- add-drop-table youdatabase> backupfilepath

3. delete a database
Drop database thedatabase

4. log out of mysql and end the mysql process.

5. delete several files except the directories under the mysql data DIRECTORY,

6. Restart mysql mysqld.

7. create database youdatabase

8. Restore mysql-u **-p ** yourdatabase <backupfilepath
 

Troubleshooting of MySQL query timeout

How to delete duplicate records in MySQL

About MySQL query Cache Mechanism

Use MySQL temporary tables to accelerate queries

Five common MySQL Log types

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.