一 简介 :mysql常见参数配置错误集锦和相关解决办法
二 前提: 1 分为可以在线和不可以在线设置参数
2 set global 会在下次session连接后生效
三 列表:
1 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size.
blob/text的值大于redo日志的增长,
此参数无法在线变更
mysql5.6 默认 innodb_log_file_size=50M 将innodb_log_file_size=256M 添加到配置文件中并重启即可
mysql5.5 需要先移除现有的redo日志,然后才能重启mysql
2 max_allowed_packet 设置过小导致java程序写入失败
此参数可以在线变更
mysql 5.6 1 max_allowed_packet=32M 写入配置文件并重启
2 set global max_allowed_packet=33554432
四 标准启动参数汇总
[mysqld]
#常规测试
port = 3306
character_set_server = utf8
socket = /tmp/mysql.sock
basedir =
datadir =
server_id=
#binlog
log_bin = mysql-bin
binlog_format=ROW
sync_binlog=1
#连接参数
max_allowed_packet=32M
max_connections=2000
skip-name-resolve
back_log = 500
#复制参数
master-info-repository=table
relay-log-info-repository=table
relay-log-recovery=1
read-only=1
relay-log = relay-bin
#慢日志
long_query_time = 1
slow_query_log = 1
slow_query_log_file =
#innodb参数
innodb_data_pool_size=内存x70%
innodb_data_file_path = ibdata1:1024M:autoextend
innodb_flush_log_at_trx_commit=1
innodb_log_file_size=256M
[mysqldump]
quick
max_allowed_packet = 32M
五 待补充