1、修改mysql最大连接数
systemctl start mysqld 启动mysql
systemctl status mysqld 查看mysql状态
systemctl restart mysqld 重启mysql进入mysql查看最大连接数:
mysql -u root -p
show variables like '%max_connections%';

1.1、方法1:临时修改
这种方式在Mysql重启后就失效
进入mysql输入:
set GLOBAL max_connections=1024;
1.2、方法2:永久修改
修改配置文件 my.cnf or my.ini。windows是my.ini,linux是 my.cnf。
在linux查找my.cnf:
# whereis my.cnf
or
# locate my.cnf

在配置文件my.cnf 中添加或修改max_connections值,重启mysql服务即可:
max_connections=512

重启mysql后查看:

https://www.cnblogs.com/xeonfeng/p/14187338.html
https://blog.csdn.net/m0_56537579/article/details/120458504