确定要调整的正确 my.cnf 文件

确定要调整的正确 my.cnf 文件

在 Centos VPS 中我想调整 Mysql 服务器:

find -name *my*cfn
./usr/share/doc/mysql-server-5.0.77/my-huge.cnf
./usr/share/doc/mysql-server-5.0.77/my-innodb-heavy-4G.cnf
./usr/share/doc/mysql-server-5.0.77/my-small.cnf
./usr/share/doc/mysql-server-5.0.77/my-medium.cnf
./usr/share/doc/mysql-server-5.0.77/my-large.cnf
./usr/share/mysql/my-huge.cnf
./usr/share/mysql/my-innodb-heavy-4G.cnf
./usr/share/mysql/my-small.cnf
./usr/share/mysql/my-medium.cnf
./usr/share/mysql/my-large.cnf
./etc/my.cnf

/etc/my.cfn的内容为:

# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

它太小了,不是吗?我必须在这里输入参数 key_buffer_size innodb_additional_mem_pool_size innodb_log_file_size 等的值吗?

答案1

嗯,这是没有任何设置的配置文件。这没问题。您可以创建[mysqld]部分并在其中调整任何您想要的内容,也可以复制其中一个示例文件 ( ./usr/share/mysql/*)/etc/my.cnf并对其进行调整。

要检查是否/etc/my.cnf正在使用,请运行mysqld --help --verbose | head -n 20并查找类似以下行:

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf

相关内容