`
san_yun
  • 浏览: 2663610 次
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

mysql 配置文件

 
阅读更多

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port        = 3306
socket        = /tmp/mysql.sock
loose-default-character-set=utf8
#default-character-set = utf8

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket        = /tmp/mysql.sock
nice        = 0

[mysqld]
#
# * Basic Settings
#

#
# * IMPORTANT
#   If you make changes to these settings and your system uses apparmor, you may
#   also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.
#
character-set-server = utf8
user        = mysql
socket        = /tmp/mysql.sock
port        = 3306
basedir        = /usr/local/mysql
datadir        = /data1/mysql
tmpdir        = /tmp
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address        = 0.0.0.0


wait_timeout            = 31536000
interactive_timeout     = 31536000

skip-name-resolve
back_log                = 500
max_connections         = 500
max_connect_errors      = 10
#external-locking

table_cache             = 512

max_allowed_packet      = 16M
binlog_cache_size       = 128M
max_heap_table_size     = 64M

sort_buffer_size        = 512M
join_buffer_size        = 512M

thread_cache_size       = 8
thread_concurrency      = 16

query_cache_size        =128M
query_cache_limit       = 512M


ft_min_word_len         = 4
#memlock
default_table_type      = innodb
thread_stack            = 192K
transaction_isolation   = READ-COMMITTED
tmp_table_size          = 256M

#log
log_warnings
log_error                = /var/log/mysql/error.log
log-short-format

slow_query_log    = 1
slow_query_log_file    = /data1/logs/mysql-slow.log
long_query_time = 0.5
log-queries-not-using-indexes

tmpdir                  = /tmp

#*** MyISAM Specific options

key_buffer_size                 = 512M
read_buffer_size                = 512M
read_rnd_buffer_size            = 512M
bulk_insert_buffer_size         = 128M
myisam_sort_buffer_size         = 128M
myisam_max_sort_file_size       = 10G
myisam_repair_threads           = 1
myisam_recover

# Here you can see queries with especially long duration
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
server-id        = 2
log_bin            = mysql-bin.log
binlog_format        = mixed

#master-host=192.168.172.3
#master-user=replication
#master-password=123456
#master-port=3306 
slave-skip-errors=all
#slave-skip-errors=1062,1053,1452
expire_logs_days    = 10
max_binlog_size         = 100M


# *** INNODB Specific options ***
#skip-innodb
innodb_additional_mem_pool_size = 64M
innodb_buffer_pool_size         = 1024m
innodb_autoextend_increment     = 256m
innodb_data_file_path = ibdata1:1000M:autoextend
innodb_read_io_threads        = 8
innodb_write_io_threads        = 4
#innodb_force_recovery           = 1
innodb_thread_concurrency       = 8
innodb_flush_log_at_trx_commit  = 0
#innodb_fast_shutdown
innodb_log_buffer_size          = 128M
innodb_log_file_size            = 256M
innodb_log_files_in_group       = 3
#innodb_log_group_home_dir
innodb_max_dirty_pages_pct      = 90
innodb_flush_method            = O_DSYNC
innodb_lock_wait_timeout        = 120
innodb_support_xa               = 0

# *** Percona Patches options ***
# http://www.percona.com/docs/wiki/patches:start

#innodb_show_verbose_locks
#innodb_show_locks_held

#userstat_running


[mysqldump]
quick
quote-names
max_allowed_packet    = 16M

[mysql]
#no-auto-rehash    # faster start of mysql but no tab completition

[isamchk]
key_buffer        = 16M

分享到:
评论

相关推荐

    MySQL配置文件解析

    MySQL配置文件解析主要涉及到MySQL服务器的参数调整,这些参数直接影响数据库的性能和稳定性。配置文件通常命名为`my.cnf`或`my.ini`,在不同的操作系统路径可能不同。以下是几个关键参数的解释: 1. `port`:指定...

    mysql配置文件

    mysql配置文件,试用于linux,/zcv/zxcvasasldkfaskdf

    大型电商 生产环境的 Mysql配置文件 my.cnf

    某电商网站的生产环境的Mysql配置文件,放入/etc/下面即可

    MySQL配置文件:my.ini

    MySQL配置文件,MySQL

    LogStash整合MySQL配置文件 jdbc.conf

    LogStash整合MySQL配置文件

    MySQL配置文件详解

    MySQL配置文件详解,对配置文件做了详细介绍,功能作用,以及如何配置。

    mysql配置文件读取顺序

    以下是关于MySQL配置文件读取顺序的详细说明。 ### 一、Windows环境下的配置文件读取顺序 在Windows操作系统中,MySQL服务遵循以下顺序读取配置文件: 1. **my.ini或my.cnf**:这是MySQL首选的配置文件名,通常...

    Mac系统,MySQL配置文件

    Mac系统的MySQL基本配置文件,亲测可用,下载后不要直接打开,如何操作使用,我的博客里面有写。

    查看linux服务器上mysql配置文件路径的方法

    在类NUIX的系统中,配置文件的位置一般在/etc/my.cnf 或者 /etc/MySQL/my.cnf ...以上就是小编为大家带来的查看linux服务器上mysql配置文件路径的方法全部内容了,希望大家多多支持软件开发网~ 您可能感兴

    mysql配置文件,通用配置

    以下是对“mysql配置文件,通用配置”这一主题的详细说明。 **一、配置文件位置** 在大多数Linux系统中,MySQL的配置文件名为`my.cnf`或`my.ini`,通常位于`/etc/mysql/`或`C:\ProgramData\MySQL\...

    mysql的配置文件

    这是mysql的配置文件,mysql多少版本之后没有了这个配置文件,需要自己创建

    MySQL配置文件、

    MySQL配置文件

    linux centos mysql配置文件说明.docx

    ### Linux CentOS MySQL 配置文件详解 #### 一、概览 在Linux CentOS环境中安装MySQL时,通过RPM包安装的方式会自带多个预设的配置文件。...此外,还可以参考官方文档或其他资源获取更多关于MySQL配置的最佳实践。

    MySQL 配置文件my.cnf 服务器适用配置

    经验总结的服务器MySQL适用配置,避免大SQL导入、数据库备份等应用问题

Global site tag (gtag.js) - Google Analytics