在mysql中,可以利用“show variables like ‘%max_connections%’;”命令查詢mysql的最大連接數;show命令用于提供多種形式獲取數據庫信息,“max_connections”用于表示最大連接數。
本教程操作環境:windows10系統、mysql8.0.22版本、Dell G3電腦。
怎么查詢mysql的最大連接數
查詢命令為:
show?variables?like?'%max_connections%';
MySQL 默認的最大連接數為 100,可以在 mysql 客戶端使用上述命令查看
此命令將得到類似以下的輸出結果:
+----------------------+-------+ |?Variable_name?|?Value?| +----------------------+-------+ |?max_connections?|?1000?| |?max_user_connections?|?1000?| +----------------------+-------+
要對 mysql 的最大連接數進行修改,只需要在 my.cnf 配置文件里面修改 max_connections 的值,然后重啟 mysql 就行。如果 my.ini 文件中沒有找到 max_connections 條目,可自行添加以下條目
max-connections?=?1000 max_user_connections?=?1000
重啟Mysql即可!
示例如下:
推薦學習:mysql視頻教程
? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
THE END
喜歡就支持一下吧
相關推薦