In the mail server, how does one restore the MySQL database from corruption?

Source: Internet
Author: User

The following article mainly explains how to handle the problem after the MySQL database in the email server is damaged. We all know that a sudden power failure may damage the MySQL database of the email server. Next we will explain it step by step.

The first step of restoring MySQL database corruption on the email server:

Stop the MuseIM Server, MuseMail Server, and MuseSQL services.

Step 2 of restoring MySQL database corruption on the email server:

In the installation directory of the email server, open the MySQL folder and find my. ini, set my. in ini, change port = 3308 to 3306 and start the MySQL service so that MySQL can be operated through the command line.

Step 3 of restoring MySQL database corruption on the email server:

Test whether the MySQL database can be accessed through the command line.

Method: Start-> Run-> Enter CMD

Go to the Mail Server installation directory MySQL/bin.

Enter MySQL-u root-p and press Enter.

Prompt for password:

Enter the password and press Enter. If you can access the mysq system normally, it means no problem, you can proceed to the next step.

Step 4 of restoring MySQL database corruption on the email server:

Use the MySQLdump command to export data

The command is as follows:

 
 
  1. MySQLdump -u root -pmUsEmAiL3005 --opt MuseMail >D:\an.sql 

If an error occurs during data export, the system will prompt the number of rows in the table that encountered an error. Then, use the Navicat for MySQL tool to delete the row,

Continue with the import command until all data can be exported normally.

The MySQL database in the mail server is damaged and restored at last:

Change the Port Back To 3308 and restart MuseSQL in the email server and Muse service.

Attached to the MySQL database deletion command:

 
 
  1. delete from tbl_imlogs where id < 35000; 

The above content is an introduction to how to deal with the MySQL database corruption on the mail server. I hope you will have some gains.

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.