mysql設定最大連線數,有三種方式
1.在啟動mysql的時候加入參數,如safe_mysqld --user=mysql --max_connections=200 &
2.加在/etc/my.cnf設定檔裡面,加入set-variable = max_connections=320
3.進入mysql改(開機後會失效),
mysql> set GLOBAL max_connections=200;
----------------------------------------------------------------------------
查看mysql的目前連線數,有兩種方式
第1種.
mysql> show status like "Threads_connected";
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| Threads_connected | 13 |
+-------------------+-------+
1 row in set (0.00 sec)
第2種.
[root]#mysqladmin extended-status|grep connect
| Aborted_connects | 127552 |
| Max_used_connections | 321 |
| Threads_connected | 36 |
[root@ccmaildb01 root]#
沒有留言:
張貼留言