3 ways to correctly modify the maximum number of connections in MySQL

3 ways to correctly modify the maximum number of connections in MySQL

We all know that after the MySQL database is installed, the default MySQL database has a maximum number of connections of 100. This number of connections is far from enough for forums or websites with slightly larger traffic. There are two ways to increase the default number of MySQL connections.

show variables like 'max_connections';

Method 1:

Go to the MySQL installation directory, open the MySQL configuration file my.ini or my.cnf, search for max_connections=100 and change it to max_connections=1000. Restart MySQL in the service.

Method 2:

The default maximum number of MySQL connections is 100 client logins:

MySQL -uusername -ppassword

Set the new maximum number of MySQL connections to 200:

MySQL> set GLOBAL max_connections=200

Display the currently running Query:

MySQL> show processlist

Displays the current status:

MySQL> show status

Exit the client: MySQL> exit

View the current maximum number of MySQL connections: MySQLadmin -uusername -ppassword variables

Method 3:

Take the manually compiled version of MySQL 5.0.33 under centos 4.4 as an example:

vi /usr/local/MySQL/bin/MySQLd_safe

Find safe_MySQLd and edit it. Find the two lines that start MySQLd and add the parameters after them:

-O max_connections=1500 

Summarize

This concludes this article on 3 ways to correctly modify the maximum number of connections in MySQL. For more information on how to modify the maximum number of connections in MySQL, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Summary of tips for setting the maximum number of connections in MySQL
  • Summarize two ways to modify the maximum number of connections in MySQL
  • Share 3 methods to modify the maximum number of MYSQL connections
  • How to increase the maximum number of connections in mysql
  • Mysql view the maximum number of connections and modify the maximum number of connections
  • How to set the maximum number of connections in MySQL

<<:  A brief talk about JavaScript Sandbox

>>:  Example code for implementing image adaptive container with CSS

Recommend

How to build a complete samba server in Linux (centos version)

Preface smb is the name of a protocol that can be...

The best explanation of HTTPS

Good morning everyone, I haven’t updated my artic...

Analysis of the difference between HTML relative path and absolute path

HTML beginners often encounter the problem of how ...

MySQL 5.7.20 compressed version download and installation simple tutorial

1. Download address: http://dev.mysql.com/downloa...

Detailed explanation of count without filter conditions in MySQL

count(*) accomplish 1. MyISAM: Stores the total n...

CSS and HTML and front-end technology layer diagram

The relationship between Javascript and DOM is ve...

Examples of correct use of interface and type methods in TypeScript

Table of contents Preface interface type Appendix...

How to deploy Confluence and jira-software in Docker

version: centos==7.2 jdk==1.8 confluence==6.15.4 ...

Pure CSS and Flutter realize breathing light effect respectively (example code)

Last time, a very studious fan asked if it was po...

JavaScript to implement the function of changing avatar

This article shares the specific code of JavaScri...

Practical record of solving MySQL deep paging problem

Table of contents Preface Why does limit deep pag...

Nginx uses ctx to realize data sharing and context modification functions

Environment: init_worker_by_lua, set_by_lua, rewr...