# 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

mysqld_multi配置MySQL多实例的更多相关文章

  1. 基于mysqld_multi实现MySQL多实例配置

    环境: 操作系统  CentOS7.5(已安装MySQL) 主机名    localhost 本机安装路径为 /usr/local/mysql 实验初始配置:所有主机关闭防火墙与selinux [ro ...

  2. mysql多实例介绍及配置

    mysql多实例介绍及配置 1.mysql多实例介绍 1.1 什么是mysql多实例 mysql多实例就是在一台机器上开启多个不同的服务端口(如:3306,3307),运行多个MySQL服务进程,通过 ...

  3. 基于mysqld_multi实现MySQL 5.7.24多实例多进程配置

    学习环境: 操作系统 IP地址 主机名 软件包 备注 CentOS7.5 192.168.200.111 localhost       实验初始配置:所有主机关闭防火墙与selinux [root@ ...

  4. Mysql多实例 安装以及配置

    MySQL多实例 1.什么是MySQL多实例 简单地说,Mysql多实例就是在一台服务器上同时开启多个不同的服务端口(3306.3307),同时运行多个Mysql服务进程,这些服务进程通过不同的soc ...

  5. mysql多实例(个人的情况,不是大众的)里面有配置好的脚本+主从复制

    [root@DB-S ~]# ll /usr/local/|grep mysql lrwxrwxrwx. 1 root root 21 Jun 14 01:52 mysql -> /alidat ...

  6. Linux平台下源码安装mysql多实例数据库

    Linux平台下源码安装mysql多实例数据库[root@linux-node1 ~]# netstat -tlunp | grep 330tcp6 0 0 :::3306 :::* LISTEN 6 ...

  7. 三十五.MySQL读写分离 MySQL多实例 、MySQL性能调优

    1.实现MySQL读写分离 搭建一主一从结构 配置maxscale代理服务器 测试分离配置   1.1 搭建一主一从结构 192.168.4.51 主 192.168.4.52 从 测试OK   1. ...

  8. Mysql多实例数据库安装应用

    第1章 MySQL多实例数据库企业级应用实践 1.1 MySQL多实例介绍 前文已经讲了为什么选择MySQL数据库,以及MySQL数据库在Linux系统下的多种安装方式,同时以单实例讲解了编译方式安装 ...

  9. Linux下MySQL多实例部署记录

    什么是MySQL多实例 简单地说,Mysql多实例就是在一台服务器上同时开启多个不同的服务端口(3306.3307),同时运行多个Mysql服务进程,这些服务进程通过不同的socket监听不同的服务端 ...

随机推荐

  1. 关闭一个winform窗体刷新另外一个

    例如Form1是你的主窗体,然后Form2是你的要关闭那个窗体,在Form1中SHOW FORM2的窗体那里加上一句f2.FormClosed += new FormClosedEventHandle ...

  2. 我们都忽略了Html5的力量,如果只看成一种技术就大错特错了!

    第一部分:Html5市场的力量 我们太忽略Html5的市场力量了.如果你把Html5当作一种技术,就大错特错了!忘掉你的产品,忘掉你的技术,想想移动时代的信息传播和消费场景.作为2B,我们实在是没有重 ...

  3. PHP初学留神(一)

    1.转义字符的使用 这个问题是在php下编写SQL语句的字符串时遇到的,因为在where后面的条件判断经常要用到双引号("")来表示字符.而诸如下面这样的语句就会报错. $quer ...

  4. 【Ubuntu12.04】安装搜狗输入法

    我的系统版本是Ubuntu12.04 32位 卸载Ibus输入法 sudo apt-get remove ibus 注意: 安装ibus的命令是  sudo apt-get install fcitx ...

  5. C语言基础知识-循环结构

    用while打印出1~100之间7的倍数    int i = 1;     while循环是当条件表达式的结果为真时,执行大括号里面的循环体,重复执行直到条件表达式的结果为假时结束循环.     w ...

  6. C#运算符之与,或,异或及移位运算

    C#运算符之与,或,异或及移位运算 1.剖析异或运算(^) 二元 ^ 运算符是为整型和 bool 类型预定义的.对于整型,^ 将计算操作数的按位“异或”.对于 bool 操作数,^ 将计算操作数的逻辑 ...

  7. Jetty使用

    目标:在Linux以及Windows下面配置应用: 之前使用过smartfox,安装的时候弹出一个浏览器,一路next,印象很深刻.只是记得他是使用Jetty.最近做的项目也是需要进行配置:过往都是使 ...

  8. 通过I2C总线向EEPROM中写入数据,记录开机次数

    没买板子之前,用protues画过电路图,实现了通过i2c总线向EEPROM中写入和读出数据. 今天,在自己买的板子上面写关于i2c总线的程序,有个地方忘了延时,调程序的时候很蛋疼.下面说说我对I2c ...

  9. hbase 0.96 java 示例

    import java.util.ArrayList; import java.util.List; import org.apache.hadoop.conf.Configuration; impo ...

  10. Linux中crond服务与crontab用法

    需要写个在Linux下定时更新系统的脚本,man crondtab 不甚详细,现将网络上的介绍列举如下: crontab是一个很方便的在unix/linux系统上定时(循环)执行某个任务的程序使用cr ...