In a Web project using Lucene, each time MySQL import new database test data need to reset Lucene will be reported "too many connections" error.
- Cause: MySQL default maximum number of connections is 100, error occurs when more than 100 connections.
- Solution One: Perform "set Global max_connections = 1000" in navicat for MySQL.
However, the modification of scenario one is only temporary, and the maximum number of connections for each restart of the database will still revert to 100, so that each time it is executed.
- Solution Two: Modify the MySQL configuration file, My.ini or my.conf, change max_connections=100 to max_connections=1000, restart MySQL.
Execute "select @ @basedir as BasePath from dual" in Navicat for MySQL, get the MySQL installation path and locate the configuration file modification.
Two ways to modify the maximum number of connections in a MySQL database