• 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
     

  • 相关阅读:
    网络请求——跨域 的概念
    花粉状二氧化硅纳米球 Pollen silica nanospheres的产品规格描述
    C++11 条件变量
    “蔚来杯“2022牛客暑期多校训练营4(A,D,H,K,N)
    CV计算机视觉每日开源代码Paper with code速览-2023.10.23
    R语言实现多变量孟德尔随机化分析(1)
    ArcGIS Pro SDK (七)编辑 5 编辑已完成事件
    【ShuQiHere】探索人工智能核心:机器学习的奥秘
    LabVIEW生成和打印条形码
    ARFoundation系列讲解 - 78 AR室内导航三
  • 原文地址:https://blog.csdn.net/sunny05296/article/details/127932650