liunx下修改mysql最大连接数(Centos下测试通过)

1、查看当前系统下mysql设置的最大连接数

方式一、

mysqladmin -uroot -p variables |grep max_connections

Linux下修改mysql默认最大连接数

 

 

方式二、

/usr/bin/mysqladmin -uroot -p variables |grep max_connections

输入数据库密码,而root则替换自己的数据库用户名,查看需要再次输入数据库的密码,即可。


2、 vi /etc/my.cnf 编辑文件

按 i 进入输入模式
按esc退出
输入 :wq 保存并退出

在[mysqld]中加入:max_connections=1000   




3、重启mysql服务:service mysqld restart 


小提示,并且不是你的mysql并发数设置越大越好,我们需要根据自己的服务器与网站状态高调整网站并发数量了。

相关文章:

  • 2022-12-23
  • 2021-07-14
  • 2021-11-02
  • 2021-12-07
  • 2021-05-21
  • 2021-11-26
猜你喜欢
  • 2021-09-22
  • 2022-01-18
  • 2022-12-23
  • 2021-07-19
  • 2022-12-23
  • 2021-07-29
  • 2021-10-20
相关资源
相似解决方案