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

Use of Linux xargs command

1. Function: xargs can convert the data separated...

About the problems of congruence and inequality, equality and inequality in JS

Table of contents Congruent and Incongruent congr...

HTML commonly used meta encyclopedia (recommended)

The Meta tag is an auxiliary tag in the head area...

Example of using negative margin to achieve average layout in CSS

For evenly distributed layouts, we generally use ...

Examples and comparison of 3 methods for deduplication of JS object arrays

Table of contents 1. Comparison of data before an...

What does mysql database do

MySQL is a relational database management system ...

Detailed explanation of Vue element plus multi-language switching

Table of contents Preface How to switch between m...

Mysql sql slow query monitoring script code example

1. Modify my.cnf #The overall effect is that both...

Detailed explanation of mysql download and installation process

1: Download MySql Official website download addre...

Sample code for CSS image animation effects (photo frame)

This article introduces the sample code of CSS pi...

An enhanced screenshot and sharing tool for Linux: ScreenCloud

ScreenCloud is a great little app you didn’t even...

MySQL optimization solution: enable slow query log

Table of contents Preface Setting up slow query l...

Detailed explanation of BOM and DOM in JavaScript

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

How to configure Linux to use LDAP user authentication

I am using LDAP user management implemented in Ce...

VMware15/16 Detailed steps to unlock VMware and install MacOS

VMware version: VMware-workstation-full-16 VMware...