怎样增加mysql的max_connections,mysql连接数默认是100, 这个数值对于并发连接很多的数据库应用是不够的,可是怎样把它适当调大呢?

找到safe_mysqld的位置,然后编辑它,找到mysqld启动的那两行,在后面加上参数
-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

这个办法有问题,设置后不起作用,下面的方法可以:

找到my.ini(在windows\下,没有就在mysql\下找)

打开它

[mysqld]
set-variable    = max_connections=16384

其中max_connections=16384就是.

相关文章:

  • 2021-08-22
  • 2021-11-06
  • 2021-07-28
  • 2021-06-23
  • 2021-05-18
  • 2022-01-15
猜你喜欢
  • 2022-12-23
  • 2021-05-06
  • 2021-12-09
  • 2021-12-31
  • 2021-11-23
  • 2021-12-20
  • 2021-10-15
相关资源
相似解决方案