• Home
  • About Us
  • Contact
  • Privacy Policy

LinuxAdmin.io

  • Home
  • Tutorials
    • System Administration
    • Linux Tutorials
    • Web Hosting
    • WordPress
    • Virtualization
    • Troubleshooting
    • OpenStack

Increasing MySQL Max Connections

How to Copy MySQL Grants

You can see what the current setting is by running the following SQL command from the MySQL command line tool, phpMyAdmin, or a similar tool:

show variables like "max_connections";

This will return a resultset like this, showing you what your current max connections setting is:

MariaDB [(none)]> show variables like "max_connections";
 +-----------------+-------+
 | Variable_name | Value |
 +-----------------+-------+
 | max_connections | 151 |
 +-----------------+-------+
 1 row in set (0.01 sec)

You can change the setting to e.g. 1200 by issuing the following command without having to restart the MySQL server (obviously it will only work if the user you are logged in as has sufficient permissions to do this):

MariaDB [(none)]> set global max_connections = 1200;
 Query OK, 0 rows affected (0.01 sec)

To make this change permanent, you will need to update the mysql conf (/etc/my.cnf) and insert the following line under [mysqld]

max_connections = 1200

That is all you need to do to increase or decrease max mysql connections without restarting mysql.

Apr 15, 2017LinuxAdmin.io
0 0 vote
Article Rating
Reset a WordPress Password with MySQLHow To Copy MySQL Grants
You Might Also Like
 
Nginx Load Balancing
 
Galera Cluster MariaDB Configuration On CentOS 7
Subscribe
Notify of
guest
guest
0 Comments
Inline Feedbacks
View all comments
6 years ago Linux Tutorials, MySQL Linux Performance Tuning1,283
Recent Posts
  • Laravel Installation Guide For CentOS
  • Openstack Services Explanation And Overview
  • OSSEC Intrusion Detection Installation On Centos 7
  • Configure ProFTPd for SFTP on CentOS
  • How To Check And Repair MyISAM Tables In MySQL
Most Commented
Hot Clone Linux Server with Rsync
Hot Clone A CentOS Server With Rsync
14 Comments
ngx_cache_purge module
Install The ngx_cache_purge Module In Nginx
8 Comments
piwik-nginx
Piwik Analytics on Nginx
8 Comments
Tags
linuxcentosLinux Performance Tuningsysadminkvmnetworkingmemcachedanalyticssystemd
About

We love Linux and are dedicated to creating Linux administration tutorials for System Administrators since 2016.

Most Viewed
Default Gateway
How To Configure A Default Gateway on CentOS
63,004 views
Zend Opcache
Setup and Optimize Zend OpCache
46,714 views
Install ffmpeg
FFMpeg Install On CentOS 7
20,912 views
Archives
Email subscription

Sign up for our newsletter to receive the latest news and event postings.

2018 © LinuxAdmin.io
wpDiscuz