MySQL View and modify the maximum number of connections

Source: Internet
Author: User
Tags mysql view

A site that uses a MySQL database, "Too many connections" error occurs when there are too many access connections. There are two cases of this error, one is that the Web site access is too large, the server can not afford, at this time should consider load balancing or other ways to reduce server pressure. Another situation is that MySQL's maximum number of connections is set too small, and when the traffic is slightly larger, there are too many connections.

MySQL default maximum number of connections is 100, you can use the following command in the MySQL client to view

Mysql> ShowVariables like' Max _connections ' ;

This command will result in output similar to the following:

+-----------------+-------+
| variable_name | Value |
+-----------------+-------+
| max_connections | 2000 |
+-----------------+-------+
1 row in Set (0.00 sec)

To modify the maximum number of MySQL connections, simply modify the max_connections value in the MY.CNF configuration file and restart MySQL. If the max_connections entry is not found in the My.ini file, you can add the following entries yourself

Max_connections = 20

MySQL View and modify the maximum number of connections

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.