DirectAdmin控制面板的Mysql优化my.cnf

二月 23, 2010 by admin · Leave a Comment 

找到my.cnf 文件,打开编辑。如果你不懂这些命令,你就用个带sftp功能的ssh客户端,把文件直接下载下来,修改,在上传覆盖。如果你熟悉命令,就直接  vi /etc/my.cnf  然后 按 i
然后复制如下配置文本:

[mysqld]
local-infile=0
skip-locking
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=500
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_cache_size=128
key_buffer=16M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=2M
read_buffer_size=2M
max_connect_errors=10
# Try number of CPU's*2 for thread_concurrency
thread_concurrency=2
myisam_sort_buffer_size=64M
server-id=1

[safe_mysqld]
err-log=/var/log/mysqld.log
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout

替换my.cnf内的文本。
保存后,然后重启
/sbin/service mysqld restart

About admin

注意:

1、本站启用了审核机制,你的留言可能稍后才会显示,请不要重复提交,谢谢。
2、留言时的头像是Gravatar提供的服务。想设置的看这里
3、评论者允许使用'@user空格'的方式将自己的评论通知另外评论者。

To submit your comment, click the image below where it asks you to... Clickcha - The One-click Captcha