• 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 votes
Article Rating
Reset a WordPress Password with MySQLHow To Copy MySQL Grants
You Might Also Like
 
Mastering NGINX Tuning: Optimizing Web Server Performance
 
Nginx Browser Caching
Subscribe
Notify of
guest

guest

0 Comments
Inline Feedbacks
View all comments
8 years ago Linux Tutorials, MySQL Linux Performance Tuning1,559
Recent Posts
  • Configuring Firewalld to Work Seamlessly with Docker on CentOS
  • Mastering NGINX Tuning: Optimizing Web Server Performance
  • Exploring eBPF: Revolutionizing Network and System Monitoring
  • Kubernetes: Installation and Overview on CentOS 8
  • Install Docker on Centos 8
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
76,146 views
Zend Opcache
Setup and Optimize Zend OpCache
47,105 views
Install ffmpeg
FFMpeg Install On CentOS 7
21,675 views
Archives
Email subscription

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

2018 © LinuxAdmin.io
wpDiscuz