多实例MySQL的/etc/my.cnf配置文件

[mysqld_multi]
mysqld = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin

[mysqld1]
datadir=/mnt/mysql/3306
socket=/tmp/mysql3306.sock
pid-file=/mnt/mysql/mysql3306.pid
log-error=/mnt/logs/mysql/3306/error.log
#general_log=/mnt/logs/mysql/3306/mysql.log

user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
port=3306
server-id=197

log-bin=mysql-bin
skip-external-locking
skip-name-resolve

key_buffer = 256M
max_allowed_packet = 1024M
net_buffer_length = 1M
#table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
ft_min_word_len = 1

query_cache_type = 1
query_cache_size = 64M

read_rnd_buffer_size = 4M
#table_open_cache = 256
thread_concurrency = 4

interactive_timeout=180
wait_timeout=180

long_query_time = 2
log_slow_queries = 1
#slow_query_log_file = /mnt/logs/mysql/3306/slow_query.log

max_connect_errors = 10000
log_bin_trust_function_creators=1

thread_cache_size = 8

innodb_file_per_table

expire_logs_day = 30

#binlog_format=mixed
master-host=42.121.3.42
master-port=3306
master-user=slaverep
master-password=TwirEmU5
#master-connect-retry=60

[mysqld2]
datadir=/mnt/mysql/3307
socket=/tmp/mysql3307.sock
pid-file=/mnt/mysql/mysql3307.pid
log-error=/mnt/logs/mysql/3307/error.log
#general_log=/mnt/logs/mysql/3307/mysql.log

user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
port=3307
server-id=115

log-bin=mysql-bin
skip-external-locking
skip-name-resolve

key_buffer = 256M
max_allowed_packet = 1M
#table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
ft_min_word_len = 1

query_cache_type = 1
query_cache_size = 64M

read_rnd_buffer_size = 4M
#table_open_cache = 256
thread_concurrency = 4

interactive_timeout=180
wait_timeout=180

long_query_time = 2
log_slow_queries = 1
#slow_query_log_file = /mnt/logs/mysql/3307/slow_query.log

max_connect_errors = 10000
log_bin_trust_function_creators=1

thread_cache_size = 8

innodb_file_per_table

expire_logs_day = 30

#binlog_format=mixed
master-host=112.124.34.26
master-port=3306
master-user=slaverep
master-password=TwirEmU5
master-connect-retry=60

[mysqld3]
datadir=/mnt/mysql/3308
socket=/tmp/mysql3308.sock
pid-file=/mnt/mysql/mysql3308.pid
log-error=/mnt/logs/mysql/3308/error.log
#general_log=/mnt/logs/mysql/3308/mysql.log

user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
port=3308
server-id=116

log-bin=mysql-bin
skip-external-locking
skip-name-resolve

key_buffer = 256M
max_allowed_packet = 1024M
net_buffer_length = 1M
#table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
ft_min_word_len = 1

query_cache_type = 1
query_cache_size = 64M

read_rnd_buffer_size = 4M
#table_open_cache = 256
thread_concurrency = 4

interactive_timeout=180
wait_timeout=180

long_query_time = 2
log_slow_queries = 1
#slow_query_log_file = /mnt/logs/mysql/3308/slow_query.log

max_connect_errors = 10000
log_bin_trust_function_creators=1

thread_cache_size = 8

innodb_file_per_table

expire_logs_day = 30

#binlog_format=mixed
master-host=112.124.7.82
master-port=3306
master-user=slaverep
master-password=TwirEmU5
#master-connect-retry=60

时间: 2024-10-24 09:54:01

多实例MySQL的/etc/my.cnf配置文件的相关文章

MySQL读取各个my.cnf配置文件的先后顺序是:

/etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf 其他自定义路径下的my.cnf,例如:/data/mysql/yejr_3306/my.cnf 不管是mysqld服务器端程序,还是mysql客户端程序,都可以采用下面两个参数来自行指定要读取的配置文件路径: -defaults-file=#, 只读取指定的文件(不再读取其他配置文件) -defaults-extra-file=#, 从其他优先级更高的配置文件中

17、MySQL生产环境my.cnf配置文件解析

[client] port = 3306    #端口号 socket = /ryzc/mysql/data/mysql.sock         #sock文件路径 [mysqld] port = 3306 socket = /ryzc/mysql/data/mysql.sock                   # 服务端sock文件路径 pid-file        = /ryzc/mysql/data/localhost.pid       # pid文件存放路径 datadir  

MySQL 5.7 my.cnf配置文件说明

[client] default-character-set = utf8mb4 [mysql] #开启 tab 补全 #auto-rehash default-character-set = utf8mb4 [mysqld] port=3306basedir=/data/server/mysql57/datadir=/data/server/mysql57/data/socket=/data/server/mysql57/data/mysql.sock symbolic-links=0log-

Linux下MySQL数据库的my.cnf配置文件,解决中文乱码问题

系统 CentOS 7.7 MySQL - 5.7.28文件放置目录:/etc/文件权限:644解决问题:存储中文数据乱码 1 # For advice on how to change settings please see 2 # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html 3 # *** DO NOT EDIT THIS FILE. It's a template which will

【mysql案例】mysql5.6.14配置my.cnf多实例,mysql_install_db初始化不读取my.cnf配置文件

1.1.1. mysql5.6.14多实例my.cnf时,初始化不读取my.cnf配置文件 [环境描述] 在多实例配置的/etc/my.cnf环境中,执行mysql_install_db后,启动Mysql报错. [操作步骤] /etc/my.cnf配置文件: [mysqld3307] innodb_data_file_path =ibdata1:1G:autoextend 初始化数据库: [[email protected] home]# mysql_install_db--datadir=/h

mysql 查看当前使用的配置文件my.cnf的方法

my.cnf是mysql启动时加载的配置文件,一般会放在mysql的安装目录中,用户也可以放在其他目录加载. 安装mysql后,系统中会有多个my.cnf文件,有些是用于测试的. 使用locate my.cnf命令可以列出所有的my.cnf文件 命令 locate my.cnf 输出 1 2 3 4 5 6 7 8 9 10 11 /usr/local/Cellar/mysql/5.6.24/my.cnf /usr/local/Cellar/mysql/5.6.24/mysql-test/inc

mysql 查看当前使用的配置文件my.cnf的方法(推荐)

my.cnf是mysql启动时加载的配置文件,一般会放在mysql的安装目录中,用户也可以放在其他目录加载. 安装mysql后,系统中会有多个my.cnf文件,有些是用于测试的. 使用locate my.cnf命令可以列出所有的my.cnf文件 命令 locate my.cnf 输出 ? 1 2 3 4 5 6 7 8 9 10 11 /usr/local/Cellar/mysql/5.6.24/my.cnf /usr/local/Cellar/mysql/5.6.24/mysql-test/i

mysql.cnf配置文件详解

Mysql参数优化对于运维来讲,是比较重要的东西,其实这个参数优化,是个很复杂的东西,对于不同的业务系统.网络情况.以及机器硬件配置都有关系,优化不可能一次性完成,需要不断的观察以及调试,才有可能得到最佳效果. mysql.cnf配置文件内容如下: [client]port = 3306socket = /mysql/data/3306/mysql.sock [mysqld]port = 3306socket = /mysql/data/3306/mysql.sock basedir = /my

多实例mysql数据库安装详解

一.实验环境 系统:cetos6.5 软件:mysql-5.5.32.tar.gz 二.实验步骤 1.1 安装cmake软件 tar xf cmake-2.8.8.tar.gz cd cmake-2.8.8 ./configure gmake gmake install 1.2 创建用户和组及其安装mysql依赖包 groupadd mysql useradd mysql -s /sbin/nologin -M msyql yum -y install ncurses-devel 1.3 解压编