Mysql 获取和设置最大连接数
登录
mysql -u root -p
mysql -h 127.0.0.1 -u root -p -P 3306
获取最大连接数
SHOW VARIABLES LIKE "max_connections";
设置最大连接数
SET GLOBAL max_connections = 500;
AWS 设置最大连接数
先安装一下 Aws cli
获取参数列表和设置参数
- https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-updating-database-parameters
- https://aws.amazon.com/cn/premiumsupport/knowledge-center/aurora-mysql-max-connection-errors/
# .local/bin/aws lightsail update-relational-database-parameters --relational-database-name <your given name> --parameters "parameterName=max_connections,parameterValue=500,applyMethod=pending-reboot"