Increase the maximum number of MySql connections

Source: Internet
Author: User
Max queries per hour --- maximum number of QUERIES PER HOUR
Max updates per hour --- maximum number of UPDATES PER HOUR
Max connections per hour --- maximum number of CONNECTIONS PER HOUR
In Win, you can modify my. ini:
4.0 and later versions are inserted under [mysqld]
Set-variable = max_connections = 1000 (or more.
More than 4.1 modify attributes of max_connections
Max_connections = 1000 (or more.
In Unix/Linux:
The maximum number of connections in mysql is 100 by default. This value is far from enough for database applications with many concurrent connections. You can increase the value as appropriate.
Whereis safe_mysqld
Find the location of safe_mysqld, edit it, find the two lines started by mysqld, and add the parameter
-O max_connections = 1000
For example
--- Safe_mysqld.orig Mon Sep 25 09:34:01 2000
++ Safe_mysqld Sun Sep 24 16:56:46 2000
@-Random, 10 + random, 10 @@
If test "$ #"-eq 0
Then
Nohup $ ledir/mysqld -- basedir = $ MY_BASEDIR_VERSION -- datadir = $ DATADIR
--- Skip-locking> $ err_log 2> & 1
+ -- Skip-locking-O max_connections = 1000 >>$ err_log 2> & 1
Else
Nohup $ ledir/mysqld -- basedir = $ MY_BASEDIR_VERSION -- datadir = $ DATADIR
--- Skip-locking "$ @" >>$ err_log 2> & 1
+ -- Skip-locking "$ @"-O max_connections = 1000 >>$ err_log 2> & 1
Fi
If test! -F $ pid_file # This is removed if normal shutdown
Then
Disable mysql and restart it.
/Mysqladmin path/mysqladmin-uroot-p variables
Enter the password of the root database account.
| Max_connections | 1000 |
That is, the new change has taken effect.
Note:
In mysql 4.07, lines 274th and 276 of the safe_mysqld file
 


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.