您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

MySQL基本配置_MySQL

2024/8/18 18:32:09发布112次查看
bitscn.com query_cache_size, tmp_table_size 这两个选项一定要设置!
# the following options will be passed to all mysql clients
[client]
#password       = your_password
port           = 3306
socket                = /home/work/mysql/tmp/mysql.sock
# here follows entries for some specific programs
# the mysql server
[mysqld]
port           = 3306
bind-address = 127.0.0.1
socket                = /home/work/mysql/tmp/mysql.sock
#skip-locking
max_allowed_packet = 1m
table_open_cache = 16
sort_buffer_size = 8m
read_buffer_size = 512k
read_rnd_buffer_size = 256k
net_buffer_length = 8k
thread_stack = 128k
# size of the key buffer, used to cache index blocks for myisam tables.
# do not set it larger than 30% of your available memory, as some memory
# is also required by the os to cache rows. even if you're not using
# myisam tables, you should still set it to 8-64m as it will also be
# used for internal temporary disk tables.
key_buffer_size = 8m
# if the temporary file used for fast index creation would be bigger
# than using the key cache by the amount specified here, then prefer the
# key cache method.  this is mainly used to force long character keys in
# large tables to use the slower key cache method to create the index.
myisam_sort_buffer_size = 8m
# query cache is used to cache select results and later return them
# without actual executing the same query once again. having the query
# cache enabled may result in significant speed improvements, if your
# have a lot of identical queries and rarely changing tables. see the
# qcache_lowmem_prunes status variable to check if the current value
# is high enough for your load.
# note: in case your tables change very often or if your queries are
# textually different every time, the query cache may result in a
# slowdown instead of a performance improvement.
query_cache_size=16m
# maximum size for internal (in-memory) temporary tables. if a table
# grows larger than this value, it is automatically converted to disk
# based table this limitation is for a single table. there can be many
# of them.
tmp_table_size=16m
# don't listen on a tcp/ip port at all. this can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# all interaction with mysqld must be made via unix sockets or named pipes.
# note that using this option without enabling named pipes on windows
# (using the enable-named-pipe option) will render mysqld useless!
#
skip-networking
server-id  = 1
# uncomment the following if you want to log updates
#log-bin=mysql-bin
# binary logging format - mixed recommended
#binlog_format=mixed
# uncomment the following if you are using innodb tables
#default_storage_engine=innodb
innodb_data_home_dir = /home/work/mysql/var/
innodb_data_file_path = ibdata1:10m:autoextend
innodb_log_group_home_dir = /home/work/mysql/var/
# you can set .._buffer_pool_size up to 50 - 80 %
# of ram but beware of setting memory usage too high
innodb_buffer_pool_size = 32m
innodb_additional_mem_pool_size = 4m
# set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 10m
innodb_log_buffer_size = 16m
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
[mysqldump]
quick
max_allowed_packet = 16m
[mysql]
no-auto-rehash
# remove the next comment character if you are not familiar with sql
#safe-updates
[myisamchk]
key_buffer_size = 8m
sort_buffer_size = 8m
[mysqlhotcopy]
interactive-timeout bitscn.com
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product