Too many connections for neutron-db-manage [MySQL]

Updated on December 6, 2022

While finalizing the installation of neutron on controller node, the operation to populate the database failed with Too many connections for neutron-db-manage. Below is the complete error:

# su -s /bin/bash neutron -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head"
Traceback (most recent call last):
File "/usr/bin/neutron-db-manage", line 10, in <module>
File "/usr/lib/python2.7/site-packages/neutron/db/migration/", line 657, in main
return_val |= bool(CONF.command.func(config,
File "/usr/lib/python2.7/site-packages/neutron/db/migration/", line 179, in do_upgrade
run_sanity_checks(config, revision)
File "/usr/lib/python2.7/site-packages/neutron/db/migration/", line 641, in run_sanity_checks

sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1040, u'Too many connections') (Background on this error at:

Fix Too many connections for neutron-db-manage

Solution: Generally, the error is due to too many simultaneous connections (means all available connections are in use by other clients) or there might be old connections (sleeping process) that are not allowing new connections to get in.

You need to increase the value of these parameters in your mysql configurations. specifically max_connections to a larger value.

Open the /etc/my.cnf file and set the below parameters

# vim /etc/my.cnf


Restart the MySQL service

# systemctl restart mariadb

Now the command to populate the database works without fail

# su -s /bin/bash neutron -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head"

Was this article helpful?

Related Articles

Leave a Comment