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.

最新文章

  1. SSH实战 · 唯唯乐购项目(中)
  2. jQuey知识点三 解析json数据
  3. NPOI读取Excel帮助类,支持xls与xlsx,实现公式解析,空行的处理
  4. Python>>>The Very First Step
  5. 崽崽帮www.zaizaibang.com精选14
  6. MVC5 + EF6 入门完整教程二:从前端的UI开始
  7. C中调用Lua函数
  8. java collections读书笔记(10) Set
  9. Intellij IDEA
  10. Redis 内存使用优化与存储
  11. iOS开发--浅谈CocoaAsyncSocket编程
  12. Sublime Text 2中前端必备的常用插件
  13. Xamarin for OSX – SetUp
  14. Win7访问局域网内共享文件夹
  15. spoj COT2 - Count on a tree II 树上莫队
  16. 开源OCR光学字符识别
  17. 201521123049 《JAVA程序设计》 第6周学习总结
  18. 开源免费接口管理平台eoLinker AMS开源版 V3.2.0更新,增加批量导出导入接口功能!
  19. 【CF1042D】Petya and Array 离散化+树状数组
  20. Python 21 Django 实用小案例1

热门文章

  1. CBitmap的使用
  2. V4L2驱动的移植与应用(一)
  3. ADS1.2中RO base与RW base
  4. 【html5】html5离线存储
  5. Xshell配色为ubuntu风格
  6. python基础练习题
  7. 【USACO4.2】草地排水Drainage Ditches(最大流)
  8. linux jdk 和tomcat环境变量配置
  9. 基于Redis的简单分布式锁的原理
  10. Injection of autowired dependencies failed