Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How linux modifies the maximum number of connections for mysql

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces linux how to modify the maximum number of connections of mysql related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that everyone after reading this linux how to modify the maximum number of connections of mysql will have a harvest, let's take a look.

Methods: 1, use "set GLOBAL max_connections= links" to temporarily modify the maximum number of connections; 2, use "vim / etc/my.cnf1" to modify the content of "max_connections", save and restart the mysql service to permanently modify the maximum number of connections.

The operating environment of this tutorial: linux7.3 system, mysql8.0.22 version, Dell G3 computer.

How to modify the maximum number of connections of mysql by linux method 1: modify temporarily

Client login:

Mysql-uroot-p

Set the new maximum number of connections to 1000:

Mysql > set GLOBAL max_connections=1000

Displays the currently running Query:

Mysql > show processlist

Show current status:

Mysql > show status

Exit the client:

Mysql > exit

View the current maximum number of connections:

Mysqladmin-uroot-p variables

This method treats the symptoms rather than the root cause, and the maximum number of connections after restarting the service is still 100. This method is used to urgently expand the maximum number of connections and is not a long-term solution.

Method 2: permanently modify

View profile location

/ usr/bin/mysql-- verbose-- help | grep-A 1 'Default optioDefault options are read from the following files in the given order:/etc/my.cnf / etc/mysql/my.cnf / usr/etc/my.cnf ~ / .my.cnf

The server reads the / etc/my.cnf file first, reads / etc/mysql/my.cnf if it does not exist, and then reads / usr/etc/my.cnf, ~ / .my.cnf

Look for the configuration file under the root path:

Find /-name my.cnf result: / etc/my.cnf

Configuration

Vim / etc/my.cnf

Edit my.cnf to add to [mysqld]:

Max_connections=1000

Restart the service

Service mysqld restart

View the number of connections

This is the end of the article mysql-u root-pshow variables like 'max_connections'; on "how linux modifies the maximum number of connections in mysql". Thank you for reading! I believe you all have a certain understanding of "how linux modifies the maximum number of connections of mysql". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report