记录一次最近遇到的问题:
关键词:max_user_connections
出现在 服务启动的时候,经过查询日志发现在服务运行过程中也会出现这个错误。
解决办法:
设置数据库中的max_user_connections的值,0代表没有限制,一般为1000。
查询max_user_connections:
修改max_user_connections:
建议使用update 只更改一个用户的max_user_connections;
ps:
当设置全局 为 100 (set global max_user_connections=100)单个用户为1000(update user set max_user_connections = "1000" where user = "test")时,当前用户实际能连接的数量也只有100。
当设置全局 为 1000 (set global max_user_connections=1000)单个用户为100(update user set max_user_connections = "100" where user = "test")时,当前用户实际能连接的数量有1000。
max_connections与max_user_connections:
max_connections:当前数据库能够连接的所有连接数,不区分用户。
max_user_connections:当前数据库用户所能连接的连接数,不会超过max_connections。
当max_connections不够时,会报下面的错误:
修改max_connections:
多实例数据库的max_connections和max_user_connections:
未完待续...