mysql多实例运行
1.主配置文件
[mysqld_multi]
mysqld = /usr/local/mysql/bin/mysqld_safe
mysqladmin = /usr/local/mysql/bin/mysqladmin
user = dbaroot
password = dbaroot20140312
[mysqld3306] #3306
port = 3306
socket = /data/mysql_3306/var/mysql_3306.sock
datadir = /data/mysql_3306/var
pid-file = /data/mysql_3306/var/mysql3306.pid
event_scheduler=1
server-id = 1
log-bin = /data/mysqllog/binlog_3306/mysql-bin
binlog_format=mixed
log_bin_trust_function_creators = 1
wait_timeout = 300
expire_logs_days = 7
default-character-set = utf8
skip-name-resolve
character-set-server = utf8
back_log = 50
max_connections = 1000
max_connect_errors = 32
max_allowed_packet = 64M
table_cache = 2048
binlog_cache_size = 1M
max_heap_table_size = 64M
tmp_table_size = 64M
key_buffer_size = 32M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 64M
sort_buffer_size = 8M
join_buffer_size = 8M
thread_cache_size = 8
thread_concurrency = 8
thread_stack = 192K
query_cache_size = 64M
query_cache_limit = 2M
tmp_table_size = 64M
ft_min_word_len = 2
default_table_type = INNODB
transaction_isolation = REPEATABLE-READ
slow_query_log
long_query_time = 2
log-short-format
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
#myisam_max_extra_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover
#skip-bdb
innodb_file_per_table = 1
innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 3G
innodb_data_file_path = ibdata1:1024M:autoextend
innodb_file_io_threads = 4
innodb_thread_concurrency = 16
innodb_flush_log_at_trx_commit = 0
innodb_log_buffer_size = 8M
innodb_log_file_size = 256M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
[mysqld3307] #3307
port = 3307
socket = /data/mysql_3307/var/mysql_3307.sock
datadir = /data/mysql_3307/var
pid-file = /data/mysql_3307/var/mysql3307.pid
event_scheduler=1
server-id = 1
log-bin = /data/mysqllog/binlog_3307/mysql-bin
binlog_format=mixed
log_bin_trust_function_creators = 1
wait_timeout = 300
expire_logs_days = 7
default-character-set = utf8
skip-name-resolve
character-set-server = utf8
back_log = 50
max_connections = 1000
max_connect_errors = 32
max_allowed_packet = 64M
table_cache = 2048
binlog_cache_size = 1M
max_heap_table_size = 64M
tmp_table_size = 64M
key_buffer_size = 32M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 64M
sort_buffer_size = 8M
join_buffer_size = 8M
thread_cache_size = 8
thread_concurrency = 8
thread_stack = 192K
query_cache_size = 64M
query_cache_limit = 2M
tmp_table_size = 64M
key_buffer_size = 32M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 64M
sort_buffer_size = 8M
join_buffer_size = 8M
thread_cache_size = 8
thread_concurrency = 8
thread_stack = 192K
query_cache_size = 64M
query_cache_limit = 2M
tmp_table_size = 64M
ft_min_word_len = 2
default_table_type = INNODB
transaction_isolation = REPEATABLE-READ
slow_query_log
long_query_time = 2
log-short-format
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
#myisam_max_extra_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover
#skip-bdb
innodb_file_per_table = 1
innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 3G
innodb_data_file_path = ibdata1:1024M:autoextend
innodb_file_io_threads = 4
innodb_thread_concurrency = 16
innodb_flush_log_at_trx_commit = 0
innodb_log_buffer_size = 8M
innodb_log_file_size = 256M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
[mysqldump]
quick
max_allowed_packet = 64M
[mysql]
no-auto-rehash
[isamchk]
key_buffer = 512M
sort_buffer_size = 512M
read_buffer = 8M
write_buffer = 8M
[myisamchk]
key_buffer = 512M
sort_buffer_size = 512M
read_buffer = 8M
write_buffer = 8M
[mysqlhotcopy]
interactive-timeout
[mysqld_safe]
open-files-limit = 8192
2.创建数据目录:
mkdir -p /data/mysql_3306/var
mkdir -p /data/mysql_3307/var
3.属主属组赋权:
chown -R mysql.root /data/mysql_330*
初始化:
/usr/local/mysql/bin/mysql_install_db --datadir=/data/mysql_3307/var/ --user=mysql
启动mysql即可。登陆的时候加上-p 3307/6.
mysql多实例运行的更多相关文章
- Windows下MySQL多实例运行(转)
关键字:Windows下MySQL多实例运行 阅读前注意事项: 1.有的版本的data目录不直接放在mysql安装目录下,有可能在:C:\ProgramData\MySQL\MySQL Server ...
- Windows下MySQL多实例运行
1.正常安装Windows版的MySQL,例如安装在C:\Program Files\MySQL文件夹里: 2.按照常规配置好MySQL: (注:5.6版本的 data文件夹与 my.ini文件在C: ...
- MYSQL 多实例运行
1.创建数据文件 mkdir /var/lib/mysql_3307 mysql_install_db --datadir=/var/lib/mysql_3307 --user=mysql 2.给数据 ...
- mysql 在一个实例运行情况下再搭建一个实例
配置mysql服务 详细步骤,请参考(http://study.lishiming.net/chapter17.html#mysql), 阿铭只把简单步骤写一下. 根据阿铭提供的地址,假如你已经搭建好 ...
- 在一台机子上,安装,运行两mysql数据库实例
为了方便测试,想要用到两个mysql数据库实例.以windows系统为例 当然安装第一个mysql数据库,很简单没什么说的.但是再要安装,运行mysql安装程序时,会提示,修复,卸载,重新安装. 这时 ...
- Mysql多实例 安装以及配置
MySQL多实例 1.什么是MySQL多实例 简单地说,Mysql多实例就是在一台服务器上同时开启多个不同的服务端口(3306.3307),同时运行多个Mysql服务进程,这些服务进程通过不同的soc ...
- Windows下MySQL多实例安装/主从复制/重置密码
Windows创建MySQL多实例 安装MYSQL和实例1 运行mysql-installer-community-5.7.16.0.msi 选择组件 MySQL Server 5.7.16 – X6 ...
- 如何在同一台机器上安装多个MySQL的实例
转自:'http://www.cnblogs.com/shangzekai/p/4375271.html 最近由于工作的需要,需要在同一台机器上搭建两个MySQL的实例,(注:已经存在了一个3306的 ...
- Mysql多实例添加到开机自启的方法
Mysql多实例配置成功后,想让配置成开机自启. 首先看一下Linux启动的知识点,顺序如下. 1 加载内核2 执行init程序3 /etc/rc.d/rc.sysinit # 由init执行的第 ...
随机推荐
- Ubuntu 11.04安装arm-linux-gcc-4.4.3/arm-none-linux-gnueabi-gcc安装包
准备工具和系统 arm-linux-gcc-4.4.3.tar.gz arm-linux-gcc-4.4.3下载地址: 下载在Linux公社的1号FTP服务器里,下载地址: FTP地址:ftp://w ...
- 使用CreateFile, ReadFile, WriteFile在Windows NT/2000/XP下读写绝对扇区的方法
也就是在CreateFile的时候打开文件名指定: "\\.\Device"就可以了. 因为代码比较短, 所以我不做注释, 相信大家看代码就能明白意思了. 另外这里读写的都是软盘A ...
- (三十)java多线程一
我们通常在电脑中打开的应用称作进程,一个应用就是一个进程,而一个进程里边一般包含多个线程. 系统要为每一个进程分配独立的内存空间,而进程里的多个线程共用这些内存. 我们通常所写的main方法就是一个线 ...
- Flash Builder4破解步骤
Flash Builder4破解步骤 1.安装Flash Builder4.0试用版 2.找到Flash Builder4的安装路径,查找如下相应的文件 3.修改如下文件下的文件 (1)找到Adobe ...
- 利用ICSharpCode.SharpZipLib进行压缩
#ZipLib is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform. It is im ...
- MFC与Webbrower交互(通过JS)
最近修改老旧的MFC项目,用的网页做界面,和HTML交互采用的是COM方式,繁琐,丑陋又性能低,于是考虑利用js来进行界面交互,查了一天的资料,现在整理如下,供后来需要的人参考,虽然大概几乎不会有人用 ...
- 教你如何制作网页上的友情链接--JavaScript基础
大部分网站的首页都有友情链接的功能,此功能可通过location对象的href属性来实现…… href属性:设置或检索完整的url字符串 1."友情链接制作"示例代码: <! ...
- 【BZOJ2959】长跑(Link-Cut Tree,并查集)
[BZOJ2959]长跑(Link-Cut Tree,并查集) 题面 BZOJ 题解 如果保证不出现环的话 妥妥的\(LCT\)傻逼题 现在可能会出现环 环有什么影响? 那就可以沿着环把所有点全部走一 ...
- 【POI2001】【HDU1814】和平委员会
题面 Description 根据宪法,Byteland民主共和国的公众和平委员会应该在国会中通过立法程序来创立. 不幸的是,由于某些党派代表之间的不和睦而使得这件事存在障碍. 此委员会必须满足下列条 ...
- 【NOIP2015】运输计划(二分,差分)
题面 Description 公元 2044 年,人类进入了宇宙纪元. L 国有 n 个星球,还有 n-1 条双向航道,每条航道建立在两个星球之间,这 n-1 条航道连通了 L 国的所有星球. 小 P ...