Increase the maximum number of MySQL connections

Source: Internet
Author: User
MySQL MySQL maximum number of connections by default is 100, this value for many concurrent connections to the database application is far from enough
, it can be properly tuned up,
Whereis Safe_mysqld
Find the location of the safe_mysqld and edit it to find the two lines that mysqld started, followed by the arguments

-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
@@ -109,10 +109,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
Then shut down MySQL and restart it, with
/mysqladmin Path/mysqladmin-uroot-p variables
Enter the password for the root database account to see
| max_connections | 1000 |
That the new changes have taken effect.


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.