Heim >Datenbank >MySQL-Tutorial >生产环境MySQL Server核心参数的配置_MySQL

生产环境MySQL Server核心参数的配置_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:35:041290Durchsuche

bitsCN.com

生产环境MySQL Server核心参数的配置

 

   ⑴ lower_case_table_names

      

      ● 推荐理由

         

         GNU/Linux 平台,对数据库、表、存储过程等对象名称大小写敏感

         为减少开发人员的开发成本,为此推荐大家设置该参数使对象名称都自动转换成小写

      

      ● 参数介绍

         

         取值范围:

         为0:区分大小写、Linux 平台默认值

         为1:不区分大小写

         

         Linux安装的MySQL的配置文件中(/etc/my.cnf)、是没有lower_case_table_names=1这行的

         在Windows安装的MySQL的配置文件中(my.ini)、是有lower_case_table_names=1这行的

         

         所以、特别提醒下、在 Replication 配置下、Master和Slave中该参数应当保持一致!!

    

    

         

   ⑵ max_connect_errors

      

      ● 推荐理由

         

         一台物理服务器只要连接 MySQL 数据库服务器 异常中断累计超过10次,就再也无法连接上mysqld服务

         为此建议大家设置此值至少大于等于10

         处理方案有 2 :

         要么重启mysqld、要么 mysqladmin flush-hosts

         

      ● 参数介绍 

         

         不过、该参数和安全相关、

         某些黑客或许会尝试失败来暴力破解密码、该值如若设置过大会留下可趁之际

         

         

         

   ⑶ interactive_timeout和wait_timeout

      

      ● 推荐理由

         

         如果你的MySQL Server有大量的闲置连接,他们不仅会白白消耗内存,而且如果连接一直在累加

         那么、最终肯定会达到MySQL Server的连接上限数,这会报'too many connections'的错误

         

         推荐值:

         inactive_timeout=172800

         wait_timeout=172800

         

      ● 参数介绍

         

         interactive_timeout

         参数含义:服务器关闭交互式连接所等待的秒数

         wait_timeout

         参数含义:服务器关闭非交互式连接所等待的秒数

         

         

         

   ⑷ transaction-isolation和binlog-format

      

      推荐配置

 

     

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn