MySQL connection number too many error 1040 (HY000): Too Many connections

Source: Internet
Author: User
Tags query meaning

Database connection Error: Error 1040 (HY000): Too Many connections 1. View the number of connections
host -u root-p123456 Status
 This command returns several values for the current state of MySQLuptime:18869 threads:1 questions:1 Slow queries:0 opens:33 Flush tables:1 c:0 queries per second avg:0. theUptime: Is the time when MySQL is running normally. Threads: Refers to the number of open sessions. Questions: Number of Customer questions (queries) since the server started (should be as long as you interact with MySQL: Whether you query the table or query server status). Slow queries: by literal meaning is slow query meaning, do not know musql think how long is enough to calculate as long query, this first put. Opens: Number of database tables that have been opened by the serverFlush Tables: The number of flush ..., refresh, and reload commands that the server has performed. Open Tables: The number of tables that are used by the database by command, starting with server startup. Queries per second Avg:select statement average query time?  2. Change the number of connections to the configuration fileThe configuration file typically exists location:/etc/my.cnfModify Entry: Increase Max_connections (maximum number of connections) and wait_timeout (Connection wait time) under [mysqld]
[Mysqld]max_connections=5000wait_timeout=5
 3. Stop and start the serviceTo stop the MySQL service:
/usr/local/mysql/bin/mysqladmin shutdown-uroot-p123456
 To start the MySQL service:
/usr/local/bin/mysqld_safe--defaults-file=/etc/my.cnf--user=root
 Description:--defaults-file for the specified configuration file--user user name for login to MySQL 4. After restarting successfully, log in to MySQL to kill connection numbergo to command line:./mysql-uroot-p123456To View connection information:mysql> show processlist;The host column is so connected to the information, ID for the corresponding identity, can kill offmysql> kill 1;

MySQL connection number too many error 1040 (HY000): Too Many 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.