How to increase MySQL connections(max_connections)?

后端 未结 3 1974
眼角桃花
眼角桃花 2020-11-29 21:28

Every socket of MySQL Database will have defaults connections as 100 but I am looking for any way to increase the number of possible connections > 100 to a socket connection

3条回答
  •  孤街浪徒
    2020-11-29 21:36

    From Increase MySQL connection limit:-

    MySQL’s default configuration sets the maximum simultaneous connections to 100. If you need to increase it, you can do it fairly easily:

    For MySQL 3.x:

    # vi /etc/my.cnf
    set-variable = max_connections = 250
    

    For MySQL 4.x and 5.x:

    # vi /etc/my.cnf
    max_connections = 250
    

    Restart MySQL once you’ve made the changes and verify with:

    echo "show variables like 'max_connections';" | mysql
    

    EDIT:-(From comments)

    The maximum concurrent connection can be maximum range: 4,294,967,295. Check MYSQL docs

提交回复
热议问题