确定正确的my.cnf文件进行调整

在Centos VPS中,我想调整Mysql Server:

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等?

那是没有任何设置的configuration文件。 没问题。 您可以创build[mysqld]部分并调整其中的任何内容,也可以将其中一个示例文件( ./usr/share/mysql/* )复制到/etc/my.cnf并调整。

要检查/etc/my.cnf是否正在使用,请运行mysqld --help --verbose | head -n 20 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