加大mysql的最大连接数
mysql的最大🏝连接数【shù】🈺默认是100, 这个数【zhè gè shù】🈺值对于【zhí duì yú】并发连接很多的数【shù】🈺据库应用是远【yòng shì yuǎn】远【yuǎn】🤯不够的,可以把👝它适当🗾调大, whereis safe_mysqld 找到【zhǎo dào】safe_mysqld的位置🛒,然后编辑它,找到【zhǎo dào】mysqld启动的【qǐ dòng de】✖那两行,在后面【zài hòu miàn】加上参【jiā shàng cān】数【shù】🈺 -O max_connections=1000
例如
--- safe_mysqld.orig Mon Sep 25 09:34:01 2000
+++ safe_mysqld Sun Sep 24 16:56:46 2000
@@ -109,10 +109,10 @@
if test "$#" -eq 0
then
nohup $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR \
- --skip-locking >> $err_log 2>&1
+ --skip-locking -O max_connections=1000 >> $err_log 2>&1
else
nohup $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR \
- --skip-locking "$@" >> $err_log 2>&1
+ --skip-locking "$@" -O max_connections=1000 >> $err_log 2>&1
fi
if test ! -f $pid_file # This is removed if normal shutdown
then
然后关【rán hòu guān】闭mysql重启它,用 /mysqladmin所在路【suǒ zài lù】径🔘/mysqladmin -uroot -p variables
输入🍭root数【shù】🈺据库账号的🐂密码后可看到👬 | max_connections | 1000 |
即新改【jí xīn gǎi】动已经生效【shēng xiào】🎴。
关键词:mysql
阅读本文后您有什么感想? 已有 人给出评价!
- 1
- 1
- 1
- 1
- 1
- 1