System Status
Buy Now
  • Email & Apps
  • Office 365
Login
  • MyRackspace Portal
  • Cloud Control Panel
  • Rackspace Webmail Login
  • Cloud Office Control Panel
  • Support Home
  • How-To
  • Developer Documentation
  •  Blogs 
    • Expert Insights Tech Blog
    • Rackspace Blog
    • Solve: Thought Leadership

Support Network

End-to-End Multicloud Solutions.   Solving Together.â„¢   Learn more at Rackspace.com

How–To Home

Cloud Servers

  • Introduction
  • FAQ
  • All Articles

Too many connections error in MySQL

Last updated on:  2021-07-01

Authored by:  Ivan Arteaga


The too many connections error appears when attempting to connect to a server and the available connections, set to 100 by default, are in use already.

Keep in mind that MySQL® has a variable max_connections +1 for client connections, the +1 is dedicated for accounts with CONNECTION_ADMIN privileges.

Solution

Perform the following steps to fix this issue:

  1. Identify the max_connections variable value:

    mysql --user="root" --password="PASSWORD" --execute='SHOW VARIABLES LIKE "max_connections";

    The output looks like this:

    Variable_name Value
    max_connections 100
  2. Use your favorite text editor to change /etc/mysql/my.cnf and set the following values:

    max_connections = 500

    max_user_connections = 500

    Note: Increasing the amount of possible connections directly affects the amount of RAM consumed.

    The command mysql --help can help locate the my.cnf file because it displays default options on the following files:

    • /etc/my.cnf
    • /etc/mysql/my.cnf
    • /usr/local/etc/my.cnf
    • ~/.my.cnf
  3. Restart the MySQL service and to apply the changes.

Share this information:

©2020 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

See license specifics and DISCLAIMER

About Rackspace
  • About
  • Customer Stories
  • Events
  • Programs
Blogs
  • The Rackspace Blog
  • Expert Insights Tech Blog
  • Solve: Thought Leadership
  • News
  • Contact Information
  • Legal
  • Careers
Site Information
  • Style Guide for Technical Content
  • Trademarks
  • Privacy Statement
  • Website Terms
Support Network
  • Support Network Home
  • Rackspace How-To
  • API Documentation
  • Developer Center
  • ©2020 Rackspace US, Inc.