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

Installation method of mysql-8.0.17-winx64 under windows 10

1. Download from the official website and unzip h...

Steps to completely uninstall the docker image

1. docker ps -a view the running image process [r...

Reasons and solutions for MySQL selecting the wrong index

In MySQL, you can specify multiple indexes for a ...

MySQL variable principles and application examples

In the MySQL documentation, MySQL variables can b...

IIS7 IIS8 reverse proxy rule writing, installation and configuration method

Purpose: Treat Station A as the secondary directo...

Mysql implements null value first/last method example

Preface We already know that MySQL uses the SQL S...

Vue implements the browser-side code scanning function

background Not long ago, I made a function about ...

Mysql WorkBench installation and configuration graphic tutorial

This article shares with you the installation and...

How to write asynchronous tasks in modern JavaScript

Preface In this article, we'll explore the ev...

CSS transparent border background-clip magic

This article mainly introduces the wonderful use ...

Detailed explanation of BOM and DOM in JavaScript

Table of contents BOM (Browser Object Model) 1. W...

Summary of Problems in Installing MySQL 5.7.19 under Linux

The first time I installed MySQL on my virtual ma...

How to implement a single file component in JS

Table of contents Overview Single file components...

How to encapsulate axios request with vue

In fact, it is very simple to encapsulate axios i...