记mysql在配置文件修改max_connections后重启重置为214.pdfVIP

  • 0
  • 0
  • 约1.02千字
  • 约 1页
  • 2026-02-05 发布于浙江
  • 举报

记mysql在配置文件修改max_connections后重启重置为214.pdf

记mysql在配置⽂件修改max_connections后重启重置为214

总总结结::

mysql的max_connections数和本⾝操作系统的open-file-limit有关。

官⽅⽂档描述为

ThemaximumnumberofconnectionsMySQLcansupportdependsonthequalityofthethreadlibraryonagivenplatform,

theamountofRAMavailable,howmuchRAMisusedforeachconnection,theworkloadfromeachconnection,andthe

desiredresponsetime.Increasingopen-files-limitmaybenecessary.AlsoseeSection2.5,“InstallingMySQLonLinux”,

forhowtoraisetheoperatingsystemlimitonhowmanyhandlescanbeusedbyMySQL.

修修改改步步骤骤

1、修改/etc/security/limits.conf,添加

rootsoftnofile65535

roothardnofile65535

*softnofile65535

*hardnofile65535

2、修改/lib/systemd/system/mysql.service,添加

LimitNOFILE=65535

LimitNPROC=65535

(注:此处路径可能与系统有关,若不在/lib/systemd/system路径下可以确认是否存在于/usr/lib/systemd/system路径下)

3、执⾏命令

systemctldaemon-reload

systemctlrestartmysql.service

附附

还遇见了其它说法,apt、yum、rpm⽅式安装的mysql在对max_connection的限制也不同。

文档评论(0)

1亿VIP精品文档

相关文档