自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Linux MYSQL命令修改各種連接的這那方法

運維 系統(tǒng)運維
方法一:進入MYSQL安裝目錄 打開Linux MYSQL命令配置文件 my.ini 或 my.cnf查找 max_connections=100 修改為 max_connections=1000 服務(wù)里重起MYSQL即可。

Linux MYSQL命令更新了很多版本更新,我本人認為Linux MYSQL命令很好使的文件系統(tǒng),在此向大家推薦。如今技術(shù)不斷更新,各種使用文件都已經(jīng)淘汰。我認為還是有很不錯的如Linux MYSQL命令值得大家來運用。今天在配置cacti時,發(fā)現(xiàn)只要增加spine的進程數(shù),就會出錯,從log中看到:SPINE: Poller[0] FATAL: Connection Failed, Error:'1040', Message:'Too many connections' (Spine thread)

查了下,應(yīng)該是默認連接太少,網(wǎng)上搜了下,這樣改:Linux MYSQL命令數(shù)據(jù)庫安裝完成后,默認最大連接數(shù)是100,一般流量稍微大一點的論壇或網(wǎng)站這個連接數(shù)是遠遠不夠的,增加默認Linux MYSQL連接數(shù)的方法有兩個

方法一:進入MYSQL安裝目錄 打開Linux MYSQL命令配置文件 my.ini 或 my.cnf查找 max_connections=100   修改為 max_connections=1000 服務(wù)里重起MYSQL即可

方法二:Linux MYSQL命令的最大連接數(shù)默認是100客戶端登錄:mysql -uusername -ppassword設(shè)置新的最大連接數(shù)為200:mysql> set GLOBAL max_connections=200顯示當(dāng)前運行的Query:mysql> show processlist顯示當(dāng)前狀態(tài):mysql> show status退出客戶端:mysql> exit查看當(dāng)前最大連接數(shù):mysqladmin -uusername -ppassword variables

方法三:以centos 4.4 下面的mysql 5.0.33 手工編譯版本為例說明:vi /usr/local/mysql/bin/mysqld_safe找到safe_mysqld編輯它,找到mysqld啟動的那兩行,在后面加上參數(shù) :-O max_connections=1500具體一點就是下面的位置:

  1. then $NOHUP_NICENESS $ledir/$MYSQLD  
  2. $defaults --basedir=$MY_BASEDIR_VERSION  
  3. --datadir=$DATADIR $USER_OPTION  
  4. --pid-file=$pid_file  
  5. --skip-external-locking  
  6. -O max_connections=1500 
  7. >> $err_log 2>&1 else  
  8. eval "$NOHUP_NICENESS $ledir/$MYSQLD  
  9. $defaults --basedir=$MY_BASEDIR_VERSION  
  10. --datadir=$DATADIR $USER_OPTION  
  11. --pid-file=$pid_file  
  12. --skip-external-locking $args  
  13. -O max_connections=1500 >> 
  14. $err_log 2>&1"保存。 

# service mysqld restart# /usr/local/mysql/bin/mysqladmin -uroot -p variables輸入root數(shù)據(jù)庫賬號的密碼后可看到max_connections 1500 即新改動已經(jīng)生效。

還有一種方法,修改原代碼:解開Linux MYSQL命令的原代碼,進入里面的sql目錄修改mysqld.cc找到下面一行:

  1. {"max_connections", OPT_MAX_CONNECTIONS,  
  2. "The number of simultaneous clients allowed.", (gptr*) &max_connections,  
  3. (gptr*) &max_connections, 0, GET_ULONG, REQUIRED_ARG, 100, 1, 16384, 0, 1,  
  4. 0}, 

把Linux MYSQL命令它改為:

  1. {"max_connections", OPT_MAX_CONNECTIONS,  
  2. "The number of simultaneous clients allowed.", (gptr*) &max_connections,  
  3. (gptr*) &max_connections, 0, GET_ULONG, REQUIRED_ARG, 1500, 1, 16384, 0, 1,  
  4. 0}, 

存盤退出,然后./configure ;make;make install可以獲得同樣的效果。

【編輯推薦】

  1. Linux mount命令于的基本用法與umount的命令
  2. Linux mount命令系統(tǒng)掛載與鏡像處理
  3. Linux vmstat進程信息和內(nèi)存信息
  4. Linux PHP編譯生成擴展與修改配置
  5. Ubuntu Linux更深入更強大更快更好
責(zé)任編輯:佚名 來源: CSDN
相關(guān)推薦

2010-06-22 17:45:34

Linux Autom

2009-08-11 10:10:05

Linux命令行修改ILinux命令行Linux命令

2010-02-04 14:42:51

Linux mysql

2012-05-04 08:19:34

Linux監(jiān)控命

2011-05-26 09:27:59

JDBC連接數(shù)據(jù)庫

2010-02-23 15:32:51

2009-12-25 13:09:49

Linux Vi

2010-10-19 10:54:02

SQL Server默

2010-05-20 14:04:11

2010-10-08 12:03:03

修改mysql字段

2010-10-14 11:48:20

MySQL賬戶密碼

2011-05-12 14:50:03

2011-05-18 14:00:44

MySQL默認密碼

2010-10-11 11:58:12

2023-11-05 09:00:00

Linux命令MySQL

2010-06-13 16:32:19

Linux Grub命

2010-11-23 09:13:47

mysql修改表結(jié)構(gòu)

2022-09-06 08:25:18

FedoraLinux

2009-08-04 09:37:34

Linux創(chuàng)建文件命令Linux創(chuàng)建文件命令

2010-10-08 11:00:40

常用mysql命令
點贊
收藏

51CTO技術(shù)棧公眾號