关闭

mysql多实例的一个配置文档

标签: mysqlbufferconcurrencycachequerysocket
747人阅读 评论(0) 收藏 举报
分类:

在修改配置之前,我们可以通过如下命令进行初始化数据库目录

bin/mysql_install_db --user=mysql --datadir=/usr/local/mysql/var3306/


#

[mysqld_multi]
mysqld     = /usr/local/mysql/bin/mysqld_safe
mysqladmin = /usr/local/mysql/bin/mysqladmin
user       = admin //数据库的账号
password   = pwd_shutdown数据库的密码

[mysqld3306]
server-id  = 3306
port       = 3306
socket     = /usr/local/mysql/tmp/mysql-3306.sock
pid-file   = /usr/local/mysql/var3306/localhost.pid
log-error = /usr/local/mysql/var3306/localhost.err
datadir    = /usr/local/mysql/var3306
log-slow-queries = /usr/local/mysql/var3306/slowquery.log
#slow_query_log_file = /usr/local/mysql/var3306/slowquery.log


skip-external-locking
skip-name-resolve
back_log = 256
key_buffer_size = 2048M
table_cache = 512K
max_allowed_packet = 16M
table_open_cache = 256
sort_buffer_size = 16M
myisam_sort_buffer_size = 512M
net_buffer_length = 1M
read_buffer_size = 8M
read_rnd_buffer_size = 4M
join_buffer_size = 16M
thread_stack = 512K
query_cache_size = 128M
thread_concurrency = 16


character-set-server = GBK
wait-timeout = 31536000
max_connections = 10000
max_connect_errors = 10000000
#log-bin=mysql-bin
#binlog_format=mixed
long_query_time = 1
user       = mysql


[mysqld3307]
server-id  = 3307
port       = 3307
socket     = /usr/loca3307l/mysql/tmp/mysql-3307.sock
pid-file   = /usr/local/mysql/var3307/localhost.pid
log-error = /usr/local/mysql/var3307/localhost.err
datadir    = /usr/local/mysql/var3307
log-slow-queries = /usr/local/mysql/var3307/slowquery.log
#slow_query_log_file = /usr/local/mysql/var3307/slowquery.log


skip-external-locking
skip-name-resolve
back_log = 256
key_buffer_size = 2048M
table_cache = 512K
max_allowed_packet = 16M
table_open_cache = 256
sort_buffer_size = 16M
myisam_sort_buffer_size = 512M
net_buffer_length = 1M
read_buffer_size = 8M
read_rnd_buffer_size = 4M
join_buffer_size = 16M
thread_stack = 512K
query_cache_size = 128M
thread_concurrency = 16


character-set-server = GBK
wait-timeout = 31536000
max_connections = 10000
max_connect_errors = 10000000
#log-bin=mysql-bin
#binlog_format=mixed
long_query_time = 1
user       = mysql




[mysqld3308]
server-id  = 3308
port       = 3308
socket     = /usr/local/mysql/tmp/mysql-3308.sock
pid-file   = /usr/local/mysql/var3308/localhost.pid
log-error = /usr/local/mysql/var3308/localhost.err
datadir    = /usr/local/mysql/var3308
log-slow-queries = /usr/local/mysql/var3308/slowquery.log
#slow_query_log_file = /usr/local/mysql/var3308/slowquery.log


skip-external-locking
skip-name-resolve
back_log = 256
key_buffer_size = 2048M
table_cache = 512K
max_allowed_packet = 16M
table_open_cache = 256
sort_buffer_size = 16M
myisam_sort_buffer_size = 512M
net_buffer_length = 1M
read_buffer_size = 8M
read_rnd_buffer_size = 4M
join_buffer_size = 16M
thread_stack = 512K
query_cache_size = 128M
thread_concurrency = 16


character-set-server = GBK
wait-timeout = 31536000
max_connections = 10000
max_connect_errors = 10000000
#log-bin=mysql-bin
#binlog_format=mixed
long_query_time = 1
user       = mysql

[mysqldump]
quick
max_allowed_packet = 16M


[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates


[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M


[mysqlhotcopy]
interactive-timeout

0
0

猜你在找
【直播】机器学习&数据挖掘7周实训--韦玮
【套餐】系统集成项目管理工程师顺利通关--徐朋
【直播】3小时掌握Docker最佳实战-徐西宁
【套餐】机器学习系列套餐(算法+实战)--唐宇迪
【直播】计算机视觉原理及实战--屈教授
【套餐】微信订阅号+服务号Java版 v2.0--翟东平
【直播】机器学习之矩阵--黄博士
【套餐】微信订阅号+服务号Java版 v2.0--翟东平
【直播】机器学习之凸优化--马博士
【套餐】Javascript 设计模式实战--曾亮
查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:2460796次
    • 积分:24984
    • 等级:
    • 排名:第239名
    • 原创:300篇
    • 转载:328篇
    • 译文:4篇
    • 评论:251条
    工作经历
    1.凤凰网:(性能测试)
    2.猎聘网:(性能+接口自动化)
    3.奇虎360(web平台*服务端测试):(服务的性能、手机浏览器性能、自动化)