国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數(shù)據(jù)庫 > MySQL > 正文

mysql too many open connections問題解決方法

2024-07-24 12:47:16
字體:
供稿:網(wǎng)友

曾經(jīng)以為在my.cnf寫入max_connections = 2000
就可以改變mysql的最大并發(fā)量,今天查到一個(gè)命令,發(fā)現(xiàn)服務(wù)器的mysql最大連接數(shù)為151.

控制臺(tái),連接上mysql

復(fù)制代碼 代碼如下:

show variables;

這條命令可以看到所有基礎(chǔ)配置

如果單獨(dú)看max_connections可以這樣

復(fù)制代碼 代碼如下:

show variables like 'max%';
+—————————-+————+
| Variable_name | Value |
+—————————-+————+
| max_allowed_packet | 1048576 |
| max_binlog_cache_size | 4294963200 |
| max_binlog_size | 1073741824 |
| max_connect_errors | 10 |
| max_connections | 151 |
| max_delayed_threads | 20 |
| max_error_count | 64 |
| max_heap_table_size | 16777216 |
| max_insert_delayed_threads | 20

151 好像是lampp默認(rèn)的最大連接數(shù)。

my.cnf里大致這樣寫的

復(fù)制代碼 代碼如下:

max_connections=2000
# The MySQL server
[mysqld]
port            = 3306
socket          = /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock

改完以后
復(fù)制代碼 代碼如下:

# The MySQL server
[mysqld]
max_connections=2000
port            = 3306

然后把max_connections=2000移動(dòng)到[mysqld]下面,重啟動(dòng)mysql
復(fù)制代碼 代碼如下:

+—————————-+————+
| Variable_name | Value |
+—————————-+————+
| max_allowed_packet | 1048576 |
| max_binlog_cache_size | 4294963200 |
| max_binlog_size | 1073741824 |
| max_connect_errors | 10 |
| max_connections | 2000 |
| max_delayed_threads | 20 |
| max_error_count | 64 |
| max_heap_table_size | 16777216 |
| max_insert_delayed_threads | 20

就好了。

說明這配置必須在[mysqld]下面,才有用。

您可能感興趣的文章:

Mysql 錯(cuò)誤too many connections解決方案解決mysql 1040錯(cuò)誤Too many connections的方法mysql "too many connections" 錯(cuò)誤 之 mysql解決方法mysql連接數(shù)設(shè)置操作方法(Too many connections)
發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 屯昌县| 广德县| 威宁| 兴仁县| 衡山县| 宣城市| 遂昌县| 长宁区| 清水县| 大田县| 吉木萨尔县| 河西区| 清水河县| 大关县| 永和县| 胶州市| 乌审旗| 开化县| 开原市| 海兴县| 南宫市| 唐海县| 灵川县| 荣成市| 满洲里市| 随州市| 肥东县| 上饶市| 大方县| 达拉特旗| 汤阴县| 新兴县| 盐津县| 全椒县| 育儿| 乌鲁木齐市| 南华县| 农安县| 长垣县| 桃江县| 额尔古纳市|