mysqld_multi配置MySQL多实例

# 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 [email protected] 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多实例,布布扣,bubuko.com

时间: 2024-10-08 10:44:15

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

mysqld_multi配置MySQL多实例(编译安装的mysql)

1编译安装mysql tar zxf mysql-5.1.73.tar.gz cd mysql-5.1.73 ./configure --prefix=/usr/local/mysql \ --enable-assembler \ --with-extra-charsets=complex \ --enable-thread-safe-client \ --with-big-tables \ --with-readline \ --with-ssl \ --with-embedded-serve

基于mysqld_multi实现MySQL多实例配置

环境: 操作系统  CentOS7.5(已安装MySQL) 主机名    localhost 本机安装路径为 /usr/local/mysql 实验初始配置:所有主机关闭防火墙与selinux [[email protected] ~]# iptables -F [[email protected] ~]# systemctl stop firewalld [[email protected] ~]# setenforce 0 MySQL多实例的原理 mysql多实例,简单理解就是在一台服务器上

mysql多实例配置

mysql多实例配置  就是在一台服务器上运行多个mysql实例,每个实例需要一个独立的端口,实例的配置可以按实际需求进行设置  1.配置mysql多实例  # vim /etc/my.cnf[mysqld_multi]mysqld = /usr/local/mysql/bin/mysqld_safemysqladmin = /usr/local/mysql/bin/mysqladminuser = mysqllog = /database/log/mysqld-muti.log join_bu

mysql 多实例应用配置部署指南

一,Mysql 多实例的作用的问题 1,有效利用服务器的资源 当单个服务器资源有剩余的时候,可以充分利用剩余的资源以提供更多的服务 2,节约服务器的资源 当公司资源紧张,但是数据库各自需要独立提供服务,而且需要主从同步等技术时候,此时使用多实例是最好的. 3,资源互相抢占的问题 当某个服务实例并发很高或者有慢查询的时候,整个实例会消耗更多的CPU,内存,磁盘IO资源,导致服务器上其他的实例提供的服务质量大大下降,相当于一个大房子,多个卧室,大家共用一个卫生间,早餐起床,一个人上厕所,长期占用,其

mysql多实例配置、权限管理

  就是在一台服务器上运行多个mysql实例,每个实例需要一个独立的端口,实例的配置可 以按实际需求进行设置 1.关闭原有的默认端口3306的mysql:service mysqd stop 2.配置mysql多实例   # vim /etc/my.cnf[mysqld_multi]mysqld = /usr/local/mysql/bin/mysqld_safemysqladmin = /usr/local/mysql/bin/mysqladminuser = mysqllog = /data

Mysql多实例 安装以及配置

MySQL多实例 1.什么是MySQL多实例 简单地说,Mysql多实例就是在一台服务器上同时开启多个不同的服务端口(3306.3307),同时运行多个Mysql服务进程,这些服务进程通过不同的socket监听不同的服务端口来提供服务. 这些Mysql多实例公用一套Mysql安装程序,使用不同的my.cnf(也可以相同)配置文件,启动程序(也可以相同)和数据文件.在提供服务时,多实例 Mysql在逻辑上看来是各自独立的,它们根据配置文件的对应设定值,获得服务器相应数量的硬件资源. 打个比方,My

MySQL多实例介绍及配置

在之前的一篇文章中,已经有介绍到怎么安装和配置MySQl了(http://blog.51cto.com/superpcm/2092357).接下来,MySQL中多实例的配置. 1.什么是MySQL多实例 简单来说,MySQL多实例就是在一台服务器上同时开启多个不同服务端口,同时运行多个MySQL服务进程,这些服务进程通过不同的socket监听不同的服务器端口来提供服务.这些MySQL多实例共用一套MySQL安装程序,使用不同的my.cnf(也可以相同)配置文件,启动程序 (也可以相同)和数据文件

MySQL多实例安装

    MySQL数据库(一) 作者:Jack 归档:学习笔记 2017/6/19 目  录 MySQl数据库(一)... 3 第1章概述:... 4 1.1 MySQL介绍:... 4 1.2 MariaDB数据库的诞生背景介绍... 4 1.3 MySQL多实例介绍... 5 1.3.1 什么是MySQL多实例... 5 1.3.2 MySQL多实例的作用与问题... 6 1.4 MySQL多实例的生产应用场景... 7 第2章关系型数据库与非关系型数据库... 8 2.1 关系型数据库..

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

Linux平台下源码安装mysql多实例数据库[[email protected] ~]# netstat -tlunp | grep 330tcp6 0 0 :::3306 :::* LISTEN 6191/mysqld [[email protected] ~]# ss -tlunp | grep 330tcp LISTEN 0 80 :::3306 :::* users:(("mysqld",pid=6191,fd=10)) [[email protected] ~]# syst