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

Issues and precautions about setting maxPostSize for Tomcat

1. Why set maxPostSize? The tomcat container has ...

The difference between ENTRYPOINT and CMD in Dockerfile

In the Docker system learning tutorial, we learne...

Detailed explanation of 10 common HTTP status codes

The HTTP status code is a 3-digit code used to in...

MySQL PXC builds a new node with only IST transmission (recommended)

Demand scenario: The existing PXC environment has...

Centos8.3, docker deployment springboot project actual case analysis

introduction Currently, k8s is very popular, and ...

Detailed explanation of how to use the Vue license plate input component

A simple license plate input component (vue) for ...

MySQL 5.6 installation steps with pictures and text

MySQL is an open source small relational database...

Example operation MySQL short link

How to set up a MySQL short link 1. Check the mys...

A brief introduction to the usage of decimal type in MySQL

The floating-point types supported in MySQL are F...

Example of implementing dynamic verification code on a page using JavaScript

introduction: Nowadays, many dynamic verification...

The latest collection of 18 green style web design works

Toy Story 3 Online Marketing Website Zen Mobile I...

React uses routing to redirect to the login interface

In the previous article, after configuring the we...

Usage and description of HTML tag tbody

The tbody element should be used in conjunction wi...

Practice of el-cascader cascade selector in elementui

Table of contents 1. Effect 2. Main code 1. Effec...