I get the MySQL error "Too many connections" in a C ++ program running on Ubuntu Linux.
This is the code that gets the error (inside the method that returns the mysql error, if any):
MYSQL connect;
mysql_init(&connect);
if (!mysql_real_connect(&connect,SERVER,USER,PASSWORD,DATABASE,0,NULL,0))
{
return mysql_error(&connect);
}
This code continues to return the string "Too many connections."
I am wondering if this is really some other mistake. This program has been running for several months before I received this error. When the error appeared, it was because I was running the program against several thousand updates / readings, and therefore yes, it is very likely that I used the available connections. The problem is that I cannot find a way to release them, if so.
Here is what I tried:
- ASSISTANTS FLUSH;
- FLUSH TABLES;
- reload MYSQL
- rebooting the machine as a whole
12 , , , reset/. , - .