Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to deal with the failure to start mysql under linux

Shulou Source: shulou.com Published: 2022-06-03 06:26:43 09月21日 Update

This article mainly introduces how to deal with the failure to start mysql under linux. The content of the article is carefully selected and edited by the author. It has a certain pertinence and is of great significance to everyone's reference. The following is to understand with the author how to deal with the failure of starting mysql under linux.

First, view the startup log

Locate the mysql profile location / etc/my.cf

The error message is as follows:

NnoDB: Data file. / ibdata1 is of a different size 768 pages (rounded down to MB) than specified in the. CNF file 1280 pages!

Cause of error:

The data file size does not match.

Linux video tutorial recommended: linux video tutorial

2. Check the file size of ibdata1

Locate the location where mysql is installed / var/run/mysql

Examples are as follows:

[root@localhost mysql] # ll-lhtotal 21M Murray RW Murray RW Murray Murray. 1 mysql mysql 10M Apr 1 09:23 ibdata1-rw-rw----. 1 mysql mysql 5.0M Apr 1 09:23 ib_logfile0-rw-rw----. 1 mysql mysql 5.0M Mar 13 07:43 ib_logfile1drwx-. 2 mysql mysql 4.0K Mar 13 07:43 mysqldrwx-. 2 mysql mysql 4.0K Mar 13 07:43 test

3. Set the size of ibdata1 to be the same as the size viewed / etc/my.cnf

Examples are as follows:

Datadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.sockinnodb_data_file_path=ibdata1:10M;ibdata2:10M:autoextend

After reading the above about how to deal with the failure to start mysql under linux, many readers must have some understanding. If you need to get more industry knowledge and information, you can continue to follow our industry information column.

Tags: Size processing file location information tutorials examples author industry video error consistency content reason meaning data article log more friends Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Technology Shulou Tech Info Microsoft MariaDB