mysql性能调优

默认:

[mysql]
default-character-set=utf8

[mysqld]
port=3306
basedir=E:/phpstudy_pro/Extensions/MySQL5.7.26/
datadir=E:/phpstudy_pro/Extensions/MySQL5.7.26/data/
character-set-server=utf8
default-storage-engine=InnoDB
max_connections=100
collation-server=utf8_unicode_ci
init_connect='SET NAMES utf8'
innodb_buffer_pool_size=64M
innodb_flush_log_at_trx_commit=1
innodb_lock_wait_timeout=120
innodb_log_buffer_size=4M
innodb_log_file_size=256M
interactive_timeout=120
join_buffer_size=2M
key_buffer_size=32M
log_error_verbosity=1
max_allowed_packet=16M
max_heap_table_size=64M
myisam_max_sort_file_size=64G
myisam_sort_buffer_size=32M
read_buffer_size=512kb
read_rnd_buffer_size=4M
server_id=1
skip-external-locking=on
sort_buffer_size=256kb
table_open_cache=256
thread_cache_size=16
tmp_table_size=64M
wait_timeout=120
[client]
port=3306
default-character-set=utf8

调整后:

[mysql]
default-character-set=utf8

[mysqld]
port=3306
basedir=E:/phpstudy_pro/Extensions/MySQL5.7.26/
datadir=E:/phpstudy_pro/Extensions/MySQL5.7.26/data/
character-set-server=utf8
default-storage-engine=InnoDB
max_connections=1024
collation-server=utf8_unicode_ci
init_connect='SET NAMES utf8'
innodb_buffer_pool_size=1G
innodb_flush_log_at_trx_commit=1
innodb_lock_wait_timeout=120
innodb_log_buffer_size=64M
innodb_log_file_size=512M
interactive_timeout=120
join_buffer_size=2M
key_buffer_size=512M
log_error_verbosity=1
max_allowed_packet=16M
max_heap_table_size=64M
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=64M
read_buffer_size=8M
read_rnd_buffer_size=8M
server_id=1
skip-external-locking=on
sort_buffer_size=8M
table_open_cache=256
thread_cache_size=80
tmp_table_size=200M
wait_timeout=120
[client]
port=3306
default-character-set=utf8

备注:具体参数需要根据服务器的配置调整。

参考:

mysql核心参数优化

Mysql性能优化、Mysql参数优化、Mysql配置优化

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值