链接数过小经常出现ERROR 1040: Too many connections错误 show variables like '%max_connections%'; 查看当前的mysql链接值 set GLOBAL max_connections=1000; 临时设置链接值 修改完成后实时生效 若要永久性修改链接数量 需要修改配置文件my.ini max_connections=1000 然后重启MySQL即可
DAOProxy的代码:下面代码中红色高亮的就是出问题的地方,DAOFactory中会构造一个PersonDAOProxy,调用listPersons或者addPerson显然会导致递归,从而导致MySQL链接数溢出!将高亮处的代码修改为:dao.listPersons().dao.addPerson(person)即可! public class PersonDAOProxy implements IPersonDAO { private DatabaseConnection conn = n
mysql 链接数满了的错误 ERROR 1040 (HY000): Too many connections 第一种处理方式: ./mysql -u root -p 登录成功后执行以下语句查询当前的最大连接数: select VARIABLE_VALUE from information_schema.GLOBAL_VARIABLES where VARIABLE_NAME='MAX_CONNECTIONS'; 执行以下语句修改最大连接数: set global max_connections