my.cnf 配置

2015-09-24

[client]
port    = 3306
socket  = /tmp/mysql.sock
[mysqld]######################commonly set##################datadir = /data/mysql/3306port = 3306server_id = 47socket = /tmp/mysql.sockskip-external-lockingskip-name-resolvedefault-storage-engine = INNODBcharacter-set-server = utf8wait_timeout = 100interactive_timeout = 100back_log = 500myisam_recoverevent_scheduler = ONsql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
log_bin = /data/mysql/3306/mysql-bin
binlog_format = row
max_binlog_size =28M
binlog_cache_size = 2M
expire-logs-days=5
######################replication#####################
#slave-net-timeout =10
#rpl_semi_sync_master_enabled = 1
#rpl_semi_sync_master_wait_no_slave = 1
#rpl_semi_sync_master_timeout = 1000
#rpl_semi_sync_slave_enabled = 1
#skip-slave-start
#log_slave_updates = 1
#relay_log_recovery = 1

####################slow log################
slow_query_log = 1
slow_query_log_file=/data/mysql/3306/mysql.slow
long_query_time = 2

####################error log###############
log-error = /data/mysql/3306/error.log

###################per_thread_buffers##################
max_connections = 1024
max_user_connections = 1000
max_connect_errors = 10000
key_buffer_size = 64M
max_allowed_packet = 128M
#table_cache = 3096
table_open_cache = 6144
table_definition_cache = 4096
sort_buffer_size = 512K
read_buffer_size = 512K
read_rnd_buffer_size = 512K
join_buffer_size = 512K
tmp_table_size = 64M
max_heap_table_size = 64M
query_cache_type = 0
query_cache_size = 0
bulk_insert_buffer_size = 32M
thread_cache_size = 64
#thread_concurrency = 8
thread_stack=256K

###################InnoDB###########################
innodb_data_home_dir=/data/mysql/3306
innodb_log_group_home_dir=/data/mysql/3306
innodb_data_file_path=ibdata1:2000M;ibdata2:10M:autoextend
innodb_buffer_pool_size=6144M
innodb_buffer_pool_instances=8
innodb_additional_mem_pool_size=16M
innodb_log_file_size=1024M
innodb_log_buffer_size=64M
innodb_log_files_in_group=3
innodb_flush_log_at_trx_commit =2
innodb_lock_wait_timeout=10
innodb_sync_spin_loops=40
innodb_max_dirty_pages_pct=90
innodb_support_xa=1
innodb_thread_concurrency=0
innodb_thread_sleep_delay=500
innodb_file_io_threads=4
log_bin_trust_function_creators=1
innodb_flush_method=O_DIRECT
innodb_file_per_table
innodb_read_io_threads=4
innodb_write_io_threads=4
innodb_io_capacity=2000
innodb_file_format=Barracuda
innodb_purge_threads=1
innodb_purge_batch_size=32
innodb_old_blocks_pct=75
innodb_change_buffering=all
transaction_isolation=READ-COMMITTED

[mysqldump]
quick
max_allowed_packet=128M
myisam_max_sort_file_size=10G

[mysql]
auto-rehashdefault-character-set = utf8

[myisamchk]
key_buffer_size=64M
sort_buffer_size=256K
read_buffer=2M
write_buffer=2M

[mysqlhotcopy]
interactive-timeout

[mysqld_safe]
open-files-limit=28192
时间: 2025-01-05 09:32:44

my.cnf 配置的相关文章

[转]MySQL5.5 my.cnf配置参考

主要配置参数转载自: http://www.linuxyw.com/a/shujuku/20130506/216.html 并稍微做了修改MyISAM部分以适应当前的环境 此配置是老男孩生产线上使用的配置,在培训的时候,他给的,我在这里,对各参数添加了中文说明这配置已经优化的不错了,如果你的mysql没有什么特殊情况的话,可以直接使用该配置参数 MYSQL服务器my.cnf配置文档详解硬件:内存16G [client]port = 3306socket = /data/3306/mysql.so

MySQL5.5 my.cnf配置参考

MySQL5.5 my.cnf配置参考 主要配置参数转载自: http://www.linuxyw.com/a/shujuku/20130506/216.html 并稍微做了修改MyISAM部分以适应当前的环境 此配置是老男孩生产线上使用的配置,在培训的时候,他给的,我在这里,对各参数添加了中文说明这配置已经优化的不错了,如果你的mysql没有什么特殊情况的话,可以直接使用该配置参数 MYSQL服务器my.cnf配置文档详解硬件:内存16G [client]port = 3306socket =

mysql my.cnf 配置建议

http://blog.csdn.net/hzcyclone/archive/2010/08/18/5821370.aspx mysql的配置文件是/etc/my.cnf,通过修改它来配置mysql. /etc/my.cnf来自以下文件: 如果你的内存≤64M,则复制/usr/share/doc/mysql/my-small.cnf为/etc/my.cnf # This is for a system with little memory ( # from time to time and it

值得收藏!my.cnf配置文档详解

MySql对于开发人员来说应该都比较熟悉,不管是小白还是老码农应该都能熟练使用.但是要说到的各种参数的配置,我敢说大部分人并不是很熟悉,当我们需要优化mysql,改变某项参数的时候.还是要到处在网上查找,有点不方便.今天就把我所知道的MySql的配置文件my.cnf做一个简单的说明吧,注意,我总结的mysql是Linux环境下的. 其实,如果你要做mysql性能优化,那么熟悉my.cnf 的相关参数是必不可少的.不然,很多时候就会出现:网上查资料说是调下某个参数性能能提升,实际你调完之后却没有任

my.cnf配置

[mysqld] port = 3306 socket = /tmp/mysql.sock basedir = /usr/local/mysql datadir = /data/mysql pid-file = /data/mysql/mysql.pid user = mysql server-id = 1 #表示是本机的序号为1,一般来讲就是master的意思,用于主从 skip-name-resolve # 禁止MySQL对外部连接进行DNS解析,使用这一选项可以消除MySQL进行DNS解析

Mysql配置文件my.cnf配置及配置参数详解

Mysql配置文件my.cnf 安装了mysql没有my.cnf文件的情况 1.可以把mysql的示例配置文件,如my-medium.cnf拷贝到/etc/my.cnf,再去修改/etc/my.cnf的配置/usr/share/doc/MySQL-server-5.5.38/my-medium.cnf(Example MySQL config file for medium systems with little memory (32M - 64M) ) 可以通过命令:find / -name 

明明在/etc/my.cnf 配置了mysql.sock,为什么会在/var/lib/mysql/mysql.sock 里边寻找

操作系统:centos7.2 mysql版本:mysql 5.7 用rpm包新安装的mysql数据库,在修改mysql的数据库存储地址时将socket路径也一同进行了修改,但是修改完成后,启动也正常,在登录数据库的时候却报出以下错误提示: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock 但是查看配置文件 vi /etc/my.cnf [mysqld] socket = /tmp/mysql

mysql my.cnf 配置详解

#配置多实例声明[mysqld_multi]mysqld = /data/mysql_bin/bin/mysqld_safemysqladmin = /data/mysql_bin/bin/mysqladminuser = userpassword = 123456 [mysqld1]#端口port = 3306user = mysql#External-locking用于多进程条件下为MyISAM数据表进行锁定 跳过skip-external-lockingcharacter_set_serv

MySQL5.7 数据库的my.cnf配置

[client] port=3306 socket=/tmp/mysql.sock default-character-set=utf8 [mysql] no-auto-rehash default-character-set=utf8 [mysqld] user = mysql port = 3306 basedir = /usr/local/mysql datadir = /usr/local/mysql/data socket = /tmp/mysql.sock pid-file = my

MongoDB之mongodb.cnf配置

# mongodb3.2.1 的主配置文件,将此文件放置于 mongodb3.2.1/bin 目录下 # hapday 2016-01-27-16:55 start # 数据文件存放目录 dbpath = /usr/local/mongodb/mongodb3.2.1/data/db # 日志文件存放目录 logpath = /usr/local/mongodb/mongodb3.2.1/logs/mongodb.log # 端口 port = 27017 # 以守护程序的方式启用,即在后台运行