mysqld_multi配置MySQL多实例_MySQL

php中文网
发布: 2016-05-31 08:49:32
原创
1510人浏览过

# this is an example of a my.cnf file for mysqld_multi.
# usually this file is located in home dir ~/.my.cnf or /etc/my.cnf
#
# some important notes follow:
#
# 1.common user
#
#   make sure that the mysql user, who is stopping the mysqld services, has
#   the same password to all mysql servers being accessed by mysqld_multi.
#   this user needs to have the 'shutdown_priv' -privilege, but for security
#   reasons should have no other privileges. it is advised that you create a
#   common 'multi_admin' user for all mysql servers being controlled by
#   mysqld_multi. here is an example how to do it:
#
#   grant shutdown on *.* to multi_admin@localhost identified by 'password'
#
#   you will need to apply the above to all mysql servers that are being
#   controlled by mysqld_multi. 'multi_admin' will shutdown the servers
#   using 'mysqladmin' -binary, when 'mysqld_multi stop' is being called.
#
# 2.pid-file
#
#   if you are using mysqld_safe to start mysqld, make sure that every
#   mysql server has a separate pid-file. in order to use mysqld_safe
#   via mysqld_multi, you need to use two options:
#
#   mysqld=/path/to/mysqld_safe
#   ledir=/path/to/mysqld-binary/
#
#   ledir (library executable directory), is an option that only mysqld_safe
#   accepts, so you will get an error if you try to pass it to mysqld directly.
#   for this reason you might want to use the above options within [mysqld#]
#   group directly.
#
# 3.data directory
#
#   it is not advised to run many mysql servers within the same data directory.
#   you can do so, but please make sure to understand and deal with the
#   underlying caveats. in short they are:
#   - speed penalty
#   - risk of table/data corruption
#   - data synchronising problems between the running servers
#   - heavily media (disk) bound
#   - relies on the system (external) file locking
#   - is not applicable with all table types. (such as innodb)
#     trying so will end up with undesirable results.
#
# 4.tcp/ip port
#
#   every server requires one and it must be unique.
#
# 5.[mysqld#] groups
#
#   in the example below the first and the fifth mysqld group was
#   intentionally left out. you may have 'gaps' in the config file. this
#   gives you more flexibility.
#
# 6.mysql server user
#
#   you can pass the user=... option inside [mysqld#] groups. this
#   can be very handy in some cases, but then you need to run mysqld_multi
#   as unix root.
#
# 7.a start-up manage script for mysqld_multi
#
#   in the recent mysql distributions you can find a file called
#   mysqld_multi.server.sh. it is a wrapper for mysqld_multi. this can
#   be used to start and stop multiple servers during boot and shutdown.
#
#   you can place the file in /etc/init.d/mysqld_multi.server.sh and
#   make the needed symbolic links to it from various run levels
#   (as per linux/unix standard). you may even replace the
#   /etc/init.d/mysql.server script with it.
#
#   before using, you must create a my.cnf file either in /usr/my.cnf
#   or /root/.my.cnf and add the [mysqld_multi] and [mysqld#] groups.
#
#   the script can be found from support-files/mysqld_multi.server.sh
#   in mysql distribution. (verify the script before using)
#


[mysqld_multi]
mysqld     = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
user       = multi_admin
password   = my_password


[mysqld2]
socket     = /tmp/mysql.sock2
port       = 3307
pid-file   = /var/lib/mysql2/hostname.pid2
datadir    = /var/lib/mysql2
language   = /usr/share/mysql/mysql/english
user       = unix_user1


[mysqld3]
mysqld     = /path/to/mysqld_safe
ledir      = /path/to/mysqld-binary/
mysqladmin = /path/to/mysqladmin
socket     = /tmp/mysql.sock3
port       = 3308
pid-file   = /var/lib/mysql3/hostname.pid3
datadir    = /var/lib/mysql3
language   = /usr/share/mysql/mysql/swedish
user       = unix_user2


[mysqld4]
socket     = /tmp/mysql.sock4
port       = 3309
pid-file   = /var/lib/mysql4/hostname.pid4
datadir    = /var/lib/mysql4
language   = /usr/share/mysql/mysql/estonia
user       = unix_user3


[mysqld6]
socket     = /tmp/mysql.sock6
port       = 3311
pid-file   = /var/lib/mysql6/hostname.pid6
datadir    = /var/lib/mysql6
language   = /usr/share/mysql/mysql/japanese
user       = unix_user4

天天团购系统
天天团购系统

天天团购系统是一套强大的开源团购程序,采用PHP+mysql开发,系统内置支付宝、财付通、GOOGLE地图等接口,支持短信发送团购券和实物团购快递发货等;另外可通过Ucenter模块,与网站已有系统无缝整合,实现用户同步注册、登陆、退出。 天天团购系统是一套创新的开源团购程序,拥有多达10项首创功能,同时支持虚拟和实物团购,内置类似淘宝的快递配送体系,并提供强大的抽奖、邀请返利等营销功能,让您轻松

天天团购系统 0
查看详情 天天团购系统
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
热门推荐
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号