How to fix abnormal startup of mysql5.7.21

How to fix abnormal startup of mysql5.7.21

A colleague reported that a MySQL instance could not be started due to a power outage. Using innodb_force_recovery=6 also didn't work, so I went to check.

Troubleshooting process:

In the earliest startup information, there is no error message, only a line of [ERROR] Aborting prompt, as follows:

Then my colleague used innodb_force_recovery=6, and the following error message appeared, but it still could not be started successfully. At this time, I decided to find out what was going on.

Filter the startup log, grep ERROR /data/mysql/3306/mysql_run.err

As you can see, all the errors are mainly as follows:

Most of the reasons why MySQL cannot be started are due to system database issues, and this one seems to be no exception.

I tried to log in to the system with --skip-grant-tables, and it worked.

/usr/local/mysql/bin/mysqld_safe --defaults-file=/data/mysql/3306/my.cnf --user=mysql --skip-grant-tables &

Next, check innodb as soon as possible and execute:

innochecksum ibdata1

Then found no output.

Then execute mysqlcheck, and it indeed repairs some errors in the tables under the mysql library. After that, restart the system in the normal way and MySQL returns to normal.

mysqlcheck -u root -p --repair -A

Summarize:

1. MySQL is not that fragile. There is no need to restore it through backup and recovery when it is damaged, which is time-consuming and laborious.

2. During the startup process, you can set --skip-grant-tables or innodb_force_recovery (this parameter needs to modify the cnf file) to let MySQL skip some checks and enable the instance to start successfully;

3. After startup, you can perform data backup or export data, and try to repair the instance;

4. This problem occurs in this instance because of improper setting of real-time saving parameters.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to view MySQL links and kill abnormal links
  • The reason why MySQL manually registers the binlog file and causes master-slave abnormalities
  • MySQL database connection exception summary (worth collecting)
  • Sharing of experience on repairing MySQL innodb exceptions
  • MySQL definition and exception handling details
  • Some basic exception handling tutorials in MySQL stored procedures
  • Analyzing a MySQL abnormal query case
  • A Brief Analysis of MySQL Exception Handling
  • Analyze several common solutions to MySQL exceptions

<<:  Should I abandon JQuery?

>>:  How to view the status of remote server files in Linux

Recommend

Use Docker to create a distributed lnmp image

Table of contents 1. Docker distributed lnmp imag...

Detailed analysis of MySQL optimization of like and = performance

introduction Most people who have used databases ...

Negative margin function introduction and usage summary

As early as in the CSS2 recommendations in 1998, t...

Implementation of Nginx operation response header information

Prerequisite: You need to compile the ngx_http_he...

Web designer's growth experience

<br />First of all, I have to state that I a...

CSS to achieve single-select folding menu function

Don’t introduce a front-end UI framework unless i...

Detailed explanation of crontab scheduled execution command under Linux

In LINUX, periodic tasks are usually handled by t...

Delegating Privileges in Linux Using Sudo

Introduction to sudo authority delegation su swit...

11 Examples of Advanced Usage of Input Elements in Web Forms

1. Cancel the dotted box when the button is press...

Full process record of Nginx reverse proxy configuration

1. Preparation Install Tomcat on Linux system, us...

Using better-scroll component in Vue to realize horizontal scrolling function

About Recently, in the process of learning Vue, I...

How to write CSS elegantly with react

Table of contents 1. Inline styles 2. Use import ...

MySQL statement arrangement and summary introduction

SQL (Structured Query Language) statement, that i...