织梦配置多个mysql_MySQL基本配置

本文详细介绍了MySQL配置文件中的一些重要参数,如query_cache_size和tmp_table_size,强调了它们对于数据库性能的影响。建议根据服务器资源合理设置这些参数以提升查询速度和内存使用效率。此外,还提到了其他关键配置,如bind-address、innodb_buffer_pool_size等,以确保数据库稳定运行。
摘要由CSDN通过智能技术生成

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//tmp/mysql.sock # Here follows entries for some specific p

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//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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值