What if MySQL directly backs up files to prevent data from being restored?

Source: Internet
Author: User

Background

I have been running the site, suddenly one day I found that the site was hung, after the investigation is the database hung off.
Login MySQL appears:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)

To restart MySQL, it appears:

stop:unknown instancestart:job failed to start

Because I found that MySQL has been hung up, so I can not backup the normal way, I think of the direct copy/var/lib/mysql files for data backup.

Business

After I reinstalled MySQL, I replaced several of the previous backups under/var/lib/mysql/dbname/. frm, start MySQL, found that the backup of the previous data is not, or the data in the newly created database.
After searching, I learned that InnoDB had to replace ibdata1, so after I replaced it, I could not successfully start my MySQL, prompt:

start:failed to start

Solve, how do I recover my previous data?

Reply content:

Background

I have been running the site, suddenly one day I found that the site was hung, after the investigation is the database hung off.
Login MySQL appears:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)

To restart MySQL, it appears:

stop:unknown instancestart:job failed to start

Because I found that MySQL has been hung up, so I can not backup the normal way, I think of the direct copy/var/lib/mysql files for data backup.

Business

After I reinstalled MySQL, I replaced several of the previous backups under/var/lib/mysql/dbname/. frm, start MySQL, found that the backup of the previous data is not, or the data in the newly created database.
After searching, I learned that InnoDB had to replace ibdata1, so after I replaced it, I could not successfully start my MySQL, prompt:

start:failed to start

Solve, how do I recover my previous data?

View the specific MYSQ error log file to resolve the problem according to the error message inside

  • Related Article

    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.