mysql标准my.cnf给我一份
时间: 2023-11-02 15:55:08 浏览: 42
以下是 MySQL 标准的 my.cnf 配置文件示例:
```
# For advice on how to change settings please see
# http://dev.mysql.com/doc/mysql/en/server-configuration-defaults.html
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
pid-file = /var/run/mysqld/mysqld.pid
log-error = /var/log/mysql/error.log
# Enable binary logging
#log-bin = /var/log/mysql/mysql-bin.log
# Point the following paths to different dedicated disks
#tmpdir = /tmp/
#log-update = /path-to-dedicated-directory/hostname
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql
#innodb_log_arch_dir = /var/lib/mysql
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
key_buffer = 16M
# Following values assume you have at least 32M ram
[myisamchk]
key_buffer = 16M
# InnoDB settings
[innodb]
innodb_file_per_table=1
innodb_buffer_pool_size=2G
innodb_log_file_size=256M
innodb_flush_log_at_trx_commit=1
innodb_lock_wait_timeout=50
[mysqld_safe]
err-log=/var/log/mysql/mysql.err
pid-file=/var/run/mysqld/mysqld.pid
```
注意:该示例仅供参考,具体的配置需要根据实际情况进行调整。