Pitfalls and solutions for upgrading MySQL 5.7.23 in CentOS 7

Pitfalls and solutions for upgrading MySQL 5.7.23 in CentOS 7

Preface

Recently, I found a pitfall in upgrading MySQL 5.7.23 under CentOS 7. Take a cluster upgraded to MySQL 5.7.23 as an example.

In our environment, the parameter open_files_limit for the number of open file descriptors is uniformly configured to 65535 in MySQL 5.6.21, while the default value of the open_files_limit parameter installed in MySQL 5.7.23 on CentOS 7 is 5000

Otherwise, in a cluster with a large number of partition tables, if the number of open files is too large, the database will report an error.

Here are the reasons:

1. CentOS 7 installs MySQL 5.7.23, and the service management has changed from sysvinit (service mysql start) to systemd (systemctl start mysqld.service)

2. The configuration of Limit under CentOS 7 is determined by the following configuration file

Global settings: /etc/systemd/system.conf (such as DefaultLimitNOFILE=65535)

Service settings: [Service] The default value is 5000, and LimitNOFILE should be changed to 65535

【test】

1. Global configuration file /etc/systemd/system.conf

2. Service configuration file /usr/lib/systemd/system/mysqld.service

3. MySQL configuration file /etc/my.cnf

【in conclusion】

1. When managing MySQL service with systemd, when setting the open_files_limit parameter in the following three configuration files at the same time, the service configuration file will prevail in the end

2. When the service-related configuration value is commented out, the global configuration file will prevail.

【Solution】

1. Single unit repair method, follow the steps below

#Modify configuration vim /usr/lib/systemd/system/mysqld.service

#Reload systemctl daemon-reload

#Restart the service to take effect systemctl restart [email protected]

2. Installation package repair method: modify the following two source files, increase 5000 to 65535, repackage and release, so that the new version will keep the same configuration as MySQL5.6.21 by default

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. If you have any questions, you can leave a message to communicate. Thank you for your support for 123WORDPRESS.COM.

You may also be interested in:
  • MySQL 5.7.30 Installation and Upgrade Issues Detailed Tutorial
  • Upgrade Docker version of MySQL 5.7 to MySQL 8.0.13, data migration
  • phpstudy2018 Tutorial on Upgrading MySQL 5.5 to 5.7 (with pictures and text)
  • Some pitfalls that developers must pay attention to after upgrading to MySQL 5.7
  • Best Practices for MySQL Upgrades
  • How to upgrade MySQL version to 5.7.17 in phpStudy
  • How to upgrade MySQL 5.6 to 5.7 under Windows
  • Detailed tutorial for upgrading MySQL 5.7.17 free installation version on Windows (x86, 64bit)
  • Some "pitfalls" of MySQL database upgrade

<<:  Detailed tutorial on deploying apollo with docker

>>:  Implementation of the function of the vue circular percentage progress bar component

Recommend

Tomcat CentOS installation process diagram

Tomcat CentOS Installation This installation tuto...

Tips for making web table frames

<br />Tips for making web table frames. ----...

The "3I" Standards for Successful Print Advertising

For many domestic advertisers, the creation and ev...

Analyze the working principle of Tomcat

SpringBoot is like a giant python, slowly winding...

Change the MySQL database engine to InnoDB

PS: I use PHPStudy2016 here 1. Stop MySQL during ...

Solve the problem of using linuxdeployqt to package Qt programs in Ubuntu

I wrote some Qt interface programs, but found it ...

mysql three tables connected to create a view

Three tables are connected. Field a of table A co...

Detailed explanation of Xshell common problems and related configurations

This article introduces common problems of Xshell...

MySQL 8.0.15 version installation tutorial connect to Navicat.list

The pitfalls 1. Many tutorials on the Internet wr...

Why MySQL does not recommend deleting data

Table of contents Preface InnoDB storage architec...

How to write DROP TABLE in different databases

How to write DROP TABLE in different databases 1....

How to build YUM in Centos7 environment

1. Enter the configuration file of the yum source...