建站软件 优化软件 编程软件 网页辅助 站群程序 网站程序 图像处理 资源教程 字体下载 推荐软件


您的位置:首页 > MYSQL学习 > 配置mysql里面my.cnf文件

配置mysql里面my.cnf文件

时间:2015-03-22 18:50:25  来源:免费模板网 作者:风雪 阅读次数 tags配置mysql

my.cnf是mysql的windows版的配置文件(linux下通常叫my.ini)。首先my.cnf是mysql能够运行的前提,或者更准确一点说,如果这个文件没有就位或者设置不对(一般就是basedir和datadir的路径不对),则mysql访问无法启动。

另外,这个文件确定了mysql的配置参数,而mysql的配置参数对mysql的性能会有较大影响。

另外就是其他区段的设置会对相应部分起作用。
MySQL性能调整之my.cnf文件的配置方法:

[mysqld]

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

skip-locking

set-variable = key_buffer=16M

set-variable = max_allowed_packet=1M

set-variable = thread_stack=64K

set-variable = record_buffer=1M

set-variable = table_cache=1024

set-variable = sort_buffer=4M

set-variable = net_buffer_length=8K

set-variable = max_connect_errors=100

set-variable = max_connections=1024

server-id = 1 
 
[mysqldump]

quick

set-variable = max_allowed_packet=16M 
 

[mysql]

no-auto-rehash

# Remove the next comment character if you are not familiar with SQL

#safe-updates 
 

[isamchk]

set-variable = key_buffer=20M

set-variable = sort_buffer=20M 
 

[myisamchk]

set-variable = key_buffer=20M

set-variable = sort_buffer=20M 
 

[mysqlhotcopy]

interactive-timeout 
 

[mysql.server]

user=mysql

basedir=/var/lib 
 

[safe_mysqld]

err-log=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

本文地址:https://www.freemoban.com/mysql/2015/0322/1077.html

猜你喜欢
栏目推荐
模板推荐

Copyright:www.freemoban.com 免费模板网 All Rights Reserved 网站备案:辽ICP备19014872号-2   辽公网安备 21010602000376号  辽公网安备:42900402000182号

免责声明:本站部分资源来自互联网收集,版权归原创者所有,如果侵犯了你的权益,我们会及时删除侵权内容,联系QQ:1615187561 谢谢合作!