How to modify the maximum number of mysql concurrent connections

Source: Internet
Author: User
Tags mysql code

How to modify the maximum number of mysql concurrent connections does not matter to MySQL. It mainly depends on the system and business logic. Method 1: Go to the MySQL installation directory and open the MYSQL configuration file my. ini or my. cnf query max_connections = 100 modify to max_connections = 1000 restart MYSQL in the service to www.2cto.com Method 2: the maximum number of connections of MySQL is 100 Client Login by default: mysql-uusername-ppassword sets the new maximum number of connections to 200: mysql> set GLOBAL max_connections = 200 to display the currently running Query: mysql> show processlist to display the current status: mysql> show status exit the client: mysql> exit www.2cto.com to view the current maximum number of connections: mysqladmin-uusern Method 3 of ame-ppassword variables: Take mysql 5.0.33 manually compiled version under centos 4.4 as an example: vi/usr/local/mysql/bin/mysqld_safe find safe_mysqld and edit it, find the two lines started by mysqld, and add the parameter "-O max_connections = 1500" to the end. The specific point is the location below: export then $ export $ ledir/$ MYSQLD $ defaults -- basedir = $ MY_BASEDIR_VERSION -- datadir = $ DATADIR $ USER_OPTION -- pid-file = $ pid_file -- skip-external-locking-O max_connections = 1500 >>>$ err_log 2> & 1 Else eval "$ export $ ledir/$ MYSQLD $ defaults -- basedir = $ MY_BASEDIR_VERSION -- datadir = $ DATADIR $ USER_OPTION -- pid-file = $ pid_file -- skip-external-locking $ args- O max_connections = 1500> $ err_log 2> & 1 "Save. # Service mysqld restart #/usr/local/mysql/bin/mysqladmin-uroot-p variables after entering the password of the root database account, you can see that www.2cto.com max_connections 1500 indicates that the new change has taken effect. Another way is to modify the original code: Unlock the original MySQL code and go to the SQL directory to modify mysqld. find The following line for cc: {"max_connections", OPT_MAX_CONNECTIONS, "The number of simultaneous clients allowed. ", (gptr *) & max_connections, (gptr *) & max_connections, 0, GET_ULONG, REQUIRED_ARG, 100, 1, 16384, 0, 1, 0}, change it: www.2cto.com {"max_connections", OPT_MAX_CONNECTIONS, "The number of simultaneous clients allowed. ", (gptr *) & max_connections, (gptr *) & max_conne Functions, 0, GET_ULONG, REQUIRED_ARG, 1500, 1, 16384, 0, 1, 0}, save the disk and exit./configure; make install can achieve the same effect.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.