• MySQL配置调优


    MySQL配置调优,修改MySQL配置文件my.ini:

    [mysql]
    default-character-set = utf8mb4

    [client]
    default-character-set = utf8mb4

    [mysqld]
    #
    # Remove leading # and set to the amount of RAM for the most important data
    # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
    # innodb_buffer_pool_size = 128M
    innodb_buffer_pool_size = 2G

    # Remove leading # to turn on a very important data integrity option: logging
    # changes to the binary log between backups.
    # log_bin
    #
    # Remove leading # to set options mainly useful for reporting servers.
    # The server defaults are faster for transactions and fast SELECTs.
    # Adjust sizes as needed, experiment to find the optimal values.
    # join_buffer_size = 128M
    # sort_buffer_size = 2M
    # read_rnd_buffer_size = 2M

    join_buffer_size = 512M
    sort_buffer_size = 16M
    read_rnd_buffer_size = 16M

    #for mysqlbinlog
    server-id=1
    log-bin=/var/lib/mysql/mysql-bin
    binlog_format=row
    expire_logs_days=15
    max_binlog_size=500m

    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock

    validate_password=off

    #character settings

    #latin1
    #character-set-server=latin1
    #collation-server=utf8_bin

    #utf8
    #character-set-server=utf8
    #collation-server=utf8_bin

    #utf8mb4
    character-set-client-handshake=false
    character-set-server=utf8mb4
    collation-server=utf8mb4_unicode_ci
    init_connect='SET NAMES utf8mb4'

    #for blob input, default value is 4194304 (4M) if not set
    #max_allowed_packet = 100M

    #other performance settings
    max_connections = 2000
    max_connect_errors = 500
    back_log = 1000
    thread_cache_size = 64
    table_open_cache_instances = 500
    ###show global status like '%open%table%'; Open_tables / Opened_tables 85%~95%
    table_open_cache = 10000
    table_definition_cache = 2000
    innodb_thread_concurrency = 0
    max_tmp_tables = 100

    ## SQL commands
    ## show engine innodb status \G;
    ## show global variables like '%thread%';
    ## show global status like '%thread%';
    ## show global status like '%open%table%';
    ## show variables like '%table%';

    # Disablinr symbolic-links is recommended to prevent assorted security risks
    symbolic-links=0

    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid
     

  • 相关阅读:
    rabbitmq配置windows authentication(windows account)登录
    Autosar实践——DEM配置
    Java:软件开发中最流行的Java框架是什么?
    真正“搞”懂HTTP协议03之时间穿梭
    FormRender使用场景及原理简介
    openpnp - 接入西门子二手飞达
    Matlab统计棋盘连通分量(空值区域)的大小和个数
    Nginx一网打尽:动静分离、压缩、缓存、黑白名单、跨域、高可用、性能优化...想要的这都有!
    doris单机安装部署
    《Head First HTML5 javascript》第1章 交互式网络 知识点总结
  • 原文地址:https://blog.csdn.net/sunny05296/article/details/127932650