FATAL: mysql_stmt_prepare() failed FATAL: MySQL error: 1461 "Can't create more than max_prepared_stmt_count statements (current value: 16382)" FATAL: `thread_init' function failed: /usr/local/share/sysbench/oltp_common.lua:282: SQL API error
MySQL的錯(cuò)誤日志信息如下:
2017-03-14T15:01:57.839154Z 348 [Note] Aborted connection 348 to db: 'sysbenchtest' user: 'root' host: 'localhost' (Got an error reading communication packets) 2017-03-14T15:01:57.839185Z 346 [Note] Aborted connection 346 to db: 'sysbenchtest' user: 'root' host: 'localhost' (Got an error reading communication packets) 看起來兩者關(guān)聯(lián)不大,所以有些信息就會(huì)有一些誤導(dǎo)了。 根據(jù)錯(cuò)誤的信息,當(dāng)前的參數(shù)max_prepared_stmt_count設(shè)置值為16382,是安裝后的默認(rèn)值。
mysql> show variables like 'max_prepared_stmt_count'; +-------------------------+-------+ | Variable_name | Value | +-------------------------+-------+ | max_prepared_stmt_count | 16382 | +-------------------------+-------+
而packet的參數(shù)設(shè)置為4M的樣子,也是默認(rèn)值
mysql> show variables like '%pack%'; +--------------------------+------------+ | Variable_name | Value | +--------------------------+------------+ | max_allowed_packet | 4194304 | | slave_max_allowed_packet | 1073741824 | +--------------------------+------------+
mysql> show global status like '%stmt%'; +----------------------------+----------+ | Variable_name | Value | +----------------------------+----------+ | Prepared_stmt_count | 27300 | +----------------------------+----------+ 10 rows in set (0.00 sec)