茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1672221 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
F09_754.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

DB研討會 : [轉貼]設定 MySQL 連線數

發表者 討論內容
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15771
[轉貼]設定 MySQL 連線數
設定MySQL連線數
Posted by jiachi under MySQL , My_Note

#查詢目前MySQL Process 狀況
mysql> show processlist;

#查詢目前MySQL max connections
mysql> show variables like ‘max_connections’;

#設定MySQL max connections
mysql> set GLOBAL max_connections=200;

但因為MySQL重開後, max_connections的設定值就會被清掉

可在 /etc/my.cnf 裡設定
set-variable = max_connections=200

存檔後,重新啟動MySQL即可

原文出處:Kiki's blog » 設定MySQL連線數
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15771
[轉貼]How to update the max_connections setting in MySQL

How to update the max_connections setting in MySQLHow to update the max_connections setting in MySQL

Posted December 10th, 2008 in MySql

If you are getting "too many connections" errors in MySQL you can change the max_connections setting to allow more connections, assuming you have enough RAM to handle the increased number. This post looks at how to update the max_connections setting in MySQL.

The default setting for max_connections is 100. You can see what the current setting is by running the following SQL command from the MySQL command line tool, phpMyAdmin, or a similar tool:



show variables like "max_connections";

This will return a resultset like this, showing you what your current max connections setting is:



+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 100 |
+-----------------+-------+

You can change the setting to e.g. 200 by issuing the following command without having to restart the MySQL server (obviously it will only work if the user you are logged in as has sufficient permissions to do this):



set global max_connections = 200;

This will take effect immediately, but will be forgotten the next time MySQL is restarted. To make the change permanent you need to edit the my.cnf configuration file. On CentOS, RedHat and similar distributions this is at /etc/my.cnf; other distros will store it elsewhere.

Under the [mysqld] section add the following setting:



max_connections = 200

Now when you restart MySQL the next time it will use this setting instead of the default.

Note that increasing the number of connections that can be made will increase the potential amount of RAM required for MySQL to run. Increase the max_connections setting with caution!


原文出處:How to update the max_connections setting in MySQL
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15771
[轉貼]MySQL 最大連線數設定
MySQL 最大連線數設定

最近剛好遇到有MySQL連線數設定過小的問題, 因此將當時緊急處理的方式紀錄一下~

首先先登入mysql

#查詢目前最大連線數
mysql> show variables like ‘max_connections’;

#設定MySQL 最大連線數
mysql> set GLOBAL max_connections=500;

因為MySQL服務重啟後,max_connections 這個值就會回復, 所以要在 /etc/my.cnf 裡, 加入以下的值.
set-variable = max_connections=500

這樣重啟後該設定就不會回復.

依版本, my.cnf 可以照以下格式寫入,
# MySQL 5
max_connections=500            # 全部接受的最大連線數
max_user_connections=20     # 每個使用者最大連線數

# MySQL 4
set-variable=max_connections=500            # 全部接受的最大連線數
set-variable=max_user_connections=20     # 每個使用者最大連線數


原文出處:MySQL 最大連線數設定
前一個主題 | 下一個主題 | 頁首 | | |



Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|