![确定要调整的正确 my.cnf 文件](https://linux22.com/image/570444/%E7%A1%AE%E5%AE%9A%E8%A6%81%E8%B0%83%E6%95%B4%E7%9A%84%E6%AD%A3%E7%A1%AE%20my.cnf%20%E6%96%87%E4%BB%B6.png)
在 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