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

mysql配置实例_MySQL

2024/3/25 4:56:37发布74次查看
bitscn.com
服务器mysql配置文件,只做参考,并做记录,留与自己使用。
# mysql server instance configuration file
# ----------------------------------------------------------------------
# generated by the mysql server instance configuration wizard
#
#
# installation instructions
# ----------------------------------------------------------------------
#
# on linux you can copy this file to /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options
# ( for this installation) or to
# ~/.my.cnf to set user-specific options.
#
# on windows you should keep this file in the installation directory
# of your server (e.g. c:/program files/mysql/mysql server x.y). to
# make sure the server reads the config file use the startup option
# --defaults-file.
#
# to run run the server from the command line, execute this in a
# command line shell, e.g.
# mysqld --defaults-file=c:/program files/mysql/mysql server x.y/my.ini
#
# to install the server as a windows service manually, execute this in a
# command line shell, e.g.
# mysqld --install mysqlxy --defaults-file=c:/program files/mysql/mysql server x.y/my.ini
#
# and then execute this in a command line shell to start the server, e.g.
# net start mysqlxy
#
#
# guildlines for editing this file
# ----------------------------------------------------------------------
#
# in this file, you can use all long options that the program supports.
# if you want to know the options a program supports, start the program
# with the --help option.
#
# more detailed information about the inpidual options can also be
# found in the manual.
#
#
# client section
# ----------------------------------------------------------------------
#
# the following options will be read by mysql client applications.
# note that only client applications shipped by mysql are guaranteed
# to read this section. if you want your own mysql client program to
# honor these values, you need to specify it as an option during the
# mysql client library initialization.
#
[client]
port=3366
[mysql]
default-character-set=utf8
# server section
# ----------------------------------------------------------------------
#
# the following options will be read by the mysql server. make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#
[mysqld]
# the tcp/ip port the mysql server will listen on
port=3366
#path to installation directory. all paths are usually resolved relative to this.
basedir=e:/mysql/mysql server 5.1/
#path to the database root
datadir=e:/mysqldb/data/
# the default character set that will be used when a new schema or table is
# created and no character set is defined
default-character-set=utf8
# the default storage engine that will be used when create new tables when
default-storage-engine=innodb
# set the sql mode to strict
sql-mode=strict_trans_tables,no_auto_create_user,no_engine_substitution
# the maximum amount of concurrent sessions the mysql server will
# allow. one of these connections will be reserved for a user with
# super privileges to allow the administrator to login even if the
# connection limit has been reached.
max_connections=200
# 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=64m
# the number of open tables for all threads. increasing this value
# increases the number of file descriptors that mysqld requires.
# therefore you have to make sure to set the amount of open files
# allowed to at least 4096 in the variable open-files-limit in
# section [mysqld_safe]
table_cache=512
# 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=64m
# how many threads we should keep in a cache for reuse. when a client
# disconnects, the client's threads are put in the cache if there aren't
# more than thread_cache_size threads from before.  this greatly reduces
# the amount of thread creations needed if you have a lot of new
# connections. (normally this doesn't give a notable performance
# improvement if you have a good thread implementation.)
thread_cache_size=16
#*** myisam specific options
# the maximum size of the temporary file mysql is allowed to use while
# recreating the index (during repair, alter table or load data infile.
# if the file-size would be bigger than this, the index will be created
# through the key cache (which is slower).
myisam_max_sort_file_size=100g
# 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=64m
# 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=256m
# size of the buffer used for doing full table scans of myisam tables.
# allocated per thread, if a full scan is needed.
read_buffer_size=2m
read_rnd_buffer_size=8m
# this buffer is allocated when mysql needs to rebuild the index in
# repair, optimze, alter table statements as well as in load data infile
# into an empty table. it is allocated per thread so be careful with
# large settings.
sort_buffer_size=2m
#*** innodb specific options ***
# use this option if you have a mysql server with innodb support enabled
# but you do not plan to use it. this will save memory and disk space
# and speed up some things.
#skip-innodb
# additional memory pool that is used by innodb to store metadata
# information.  if innodb requires more memory for this purpose it will
# start to allocate it from the os.  as this is fast enough on most
# recent operating systems, you normally do not need to change this
# value. show innodb status will display the current amount used.
innodb_additional_mem_pool_size=20m
# if set to 1, innodb will flush (fsync) the transaction logs to the
# disk at each commit, which offers full acid behavior. if you are
# willing to compromise this safety, and you are running small
# transactions, you may set this to 0 or 2 to reduce disk i/o to the
# logs. value 0 means that the log is only written to the log file and
# the log file flushed to disk approximately once per second. value 2
# means the log is written to the log file at each commit, but the log
# file is only flushed to disk approximately once per second.
innodb_flush_log_at_trx_commit=0
# the size of the buffer innodb uses for buffering log data. as soon as
# it is full, innodb will have to flush it to disk. as it is flushed
# once per second anyway, it does not make sense to have it very large
# (even with long transactions).
innodb_log_buffer_size=8m
# innodb, unlike myisam, uses a buffer pool to cache both indexes and
# row data. the bigger you set this the less disk i/o is needed to
# access data in tables. on a dedicated database server you may set this
# parameter up to 80% of the machine physical memory size. do not set it
# too large, though, because competition of the physical memory may
# cause paging in the operating system.  note that on 32bit systems you
# might be limited to 2-3.5g of user level memory per process, so do not
# set it too high.
innodb_buffer_pool_size=512m
# size of each log file in a log group. you should set the combined size
# of log files to about 25%-100% of your buffer pool size to avoid
# unneeded buffer pool flush activity on log file overwrite. however,
# note that a larger logfile size will increase the time needed for the
# recovery process.
innodb_log_file_size=256m
# number of threads allowed inside the innodb kernel. the optimal value
# depends highly on the application, hardware as well as the os
# scheduler properties. a too high value may lead to thread thrashing.
innodb_thread_concurrency=4
max_allowed_packet=8m
net_buffer_length = 8k
join_buffer_size = 2m
query_cache_limit = 2m
innodb_lock_wait_timeout = 50
back_log = 1024
slow_query_log=1
log_output=file
slow_query_log_file=mysql_slow.log
long_query_time=2
innodb_support_xa=0
concurrent_insert=2
本文出自 “飘渺云庐” 博客
bitscn.com
芜湖分类信息网,免费分类信息发布

VIP推荐

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