mysql多实例配置文件

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
云数据库 RDS MySQL,高可用系列 2核4GB
简介:

#++++++++++++++++++++++++++++++++ multi ++++++++++++++++++++++++++

[mysqld_multi]

mysqld = /usr/local/mysqlinstance/bin/mysqld_safe

mysqladmin = /usr/local/mysqlinstance/bin/mysqladmin

use = root

log = /usr/local/mysqlinstance/logs/multi.log


#+++++++++++++++++++++++++++++++client+++++++++++++++++++++++++++

[client]

default-character-set = utf8


#+++++++++++++++++++++++++++++mysql+++++++++++++++++++++++++++++

[mysql]

prompt = mysql(\\u@\h-\R:\\m:\\s [\\d])>

#提示当前数据库操作用户名、库名、时间等

default-character-set=utf8


#++++++++++++++++++++++++++++++++++iapppay++++++++++++++++++++++++++

[mysqld3307]

user = mysql

port = 3307

character-set-server=utf8

socket = /data1/iapppay/mysql.sock

pid-file = /data1/iapppay/mysql.pid

datadir = /data1/iapppay/data

tmpdir = /data1/iapppay/tmpdir

big_tables

skip_external_locking

skip-name-resolve

lower_case_table_names = 1

back_log = 100

#default-storage-engine = INNODB

max_connections = 3000

max_connect_errors = 100000

interactive_timeout = 28800

wait_timeout = 28800

max_allowed_packet = 32M

max_heap_table_size = 128M

tmp_table_size = 128M

max_length_for_sort_data = 4096

net_buffer_length = 8K

sort_buffer_size = 8M

join_buffer_size = 1M

read_buffer_size = 1M

read_rnd_buffer_size = 2M

table_cache = 1024

thread_cache_size = 64

thread_concurrency = 8

query_cache_type = 0

query_cache_size = 64M

query_cache_limit = 1M

#******************************* Logs related settings ***************************

log-error = /data1/iapppay/logs/error.log

log_warnings

long_query_time = 1

slow_query_log

slow_query_log_file = /data1/iapppay/logs/slow-query.log

log_queries_not_using_indexes

binlog_cache_size = 8M

max_binlog_size = 512M

log-bin = /data1/iapppay/binlog/mysql-bin

log-bin-index = /data1/iapppay/binlog/mysql-bin.index

expire_logs_days = 30

#******************************* Replication related settings **********************

server-id = 1000

report_port = 3309

report_user = repl

slave_net_timeout = 60

innodb_flush_log_at_trx_commit = 1

sync_binlog = 1

binlog-format = ROW

transaction_isolation = REPEATABLE-READ

slave-skip-errors = 1062

#******************************* MyISAM Specific options ****************************

key_buffer_size = 32M

bulk_insert_buffer_size = 16M

myisam_sort_buffer_size = 64M

myisam_max_sort_file_size = 1G

myisam_repair_threads = 1

myisam_recover

#***************************** INNODB Specific options ******************************

innodb_file_per_table = 1

innodb_autoinc_lock_mode = 1

innodb_fast_shutdown = 0

innodb_additional_mem_pool_size = 64M

innodb_buffer_pool_size = 6G

innodb_data_home_dir = /data1/iapppay/data

innodb_data_file_path = ibdata1:256M:autoextend

innodb_file_io_threads = 4

innodb_thread_concurrency = 4

innodb_log_buffer_size = 8M

innodb_log_file_size = 128M

innodb_log_group_home_dir = /data1/iapppay/logs/innodb_log

innodb_max_dirty_pages_pct = 20

innodb_lock_wait_timeout = 120

innodb_flush_method=O_DIRECT



#++++++++++++++++++++++++++++++++++lenovo++++++++++++++++++++++++++

[mysqld3310]

user = mysql

port = 3310

socket = /usr/local/mysqlinstance/data/lenovo/mysql.sock

pid-file = /usr/local/mysqlinstance/data/lenovo/mysql.pid

datadir = /usr/local/mysqlinstance/data/lenovo/data

tmpdir = /usr/local/mysqlinstance/data/lenovo/tmpdir

big_tables

skip_external_locking

skip-name-resolve

lower_case_table_names = 1

back_log = 100

#default-storage-engine = INNODB

max_connections = 3000

max_connect_errors = 100000

interactive_timeout = 28800

wait_timeout = 28800

max_allowed_packet = 32M

max_heap_table_size = 128M

tmp_table_size = 128M

max_length_for_sort_data = 4096

net_buffer_length = 8K

sort_buffer_size = 8M

join_buffer_size = 1M

read_buffer_size = 1M

read_rnd_buffer_size = 2M

table_cache = 1024

thread_cache_size = 64

thread_concurrency = 8

query_cache_type = 0

query_cache_size = 64M

query_cache_limit = 1M

#******************************* Logs related settings ***************************

log-error = /usr/local/mysqlinstance/data/lenovo/logs/error.log

log_warnings

long_query_time = 1

slow_query_log

slow_query_log_file = /usr/local/mysqlinstance/data/lenovo/logs/slow-query.log

log_queries_not_using_indexes

binlog_cache_size = 8M

max_binlog_size = 512M

log-bin = /usr/local/mysqlinstance/data/lenovo/binlog/mysql-bin

log-bin-index = /usr/local/mysqlinstance/data/lenovo/binlog/mysql-bin.index

expire_logs_days = 30

#******************************* Replication related settings **********************

server-id = 1010

report_port = 3310

report_user = repl

slave_net_timeout = 60

innodb_flush_log_at_trx_commit = 1

sync_binlog = 1

binlog-format = ROW

transaction_isolation = REPEATABLE-READ

slave-skip-errors = 1062

#******************************* MyISAM Specific options ****************************

key_buffer_size = 32M

bulk_insert_buffer_size = 16M

myisam_sort_buffer_size = 64M

myisam_max_sort_file_size = 1G

myisam_repair_threads = 1

myisam_recover

#***************************** INNODB Specific options ******************************

innodb_file_per_table = 1

innodb_autoinc_lock_mode = 1

innodb_fast_shutdown = 0

innodb_additional_mem_pool_size = 64M

innodb_buffer_pool_size = 8G

innodb_data_home_dir = /usr/local/mysqlinstance/data/lenovo/data

innodb_data_file_path = ibdata1:256M:autoextend

innodb_file_io_threads = 4

innodb_thread_concurrency = 4

innodb_log_buffer_size = 8M

innodb_log_file_size = 128M

innodb_log_group_home_dir = /usr/local/mysqlinstance/data/lenovo/logs/innodb_log

innodb_max_dirty_pages_pct = 20

innodb_lock_wait_timeout = 120

innodb_flush_method=O_DIRECT



#++++++++++++++++++++++++++++++++++++++++mysqldump++++++++++++++++++++++

[mysqldump]

quick

max_allowed_packet = 2G





     本文转自aaron428 51CTO博客,原文链接:http://blog.51cto.com/aaronsa/1741501,如需转载请自行联系原作者


相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
4月前
|
存储 关系型数据库 MySQL
MySQL数据类型详解及实例应用
MySQL数据类型详解及实例应用
116 4
|
4月前
|
Prometheus 监控 Cloud Native
使用mysqld_exporter监控所有MySQL实例
使用mysqld_exporter监控所有MySQL实例
134 2
|
26天前
|
固态存储 关系型数据库 MySQL
mysql多实例一键部署
mysql多实例一键部署
18 0
|
2月前
|
Prometheus 监控 Cloud Native
Prometheus结合Consul采集多个MySQL实例的监控指标
将 Prometheus 与 Consul 结合使用,实现对多个 MySQL 实例的自动发现与监控,不仅提高了监控的效率和准确性,也为管理动态扩缩容的数据库环境提供了强大的支持。通过细致配置每一部分,业务可以获得关键的性能指标和运行健康状况的即时反馈,进而优化资源配置,提高系统的稳定性和可用性。
68 3
|
2月前
|
分布式计算 大数据 关系型数据库
MaxCompute产品使用合集之如何实现类似mysql实例中的数据库功能
MaxCompute作为一款全面的大数据处理平台,广泛应用于各类大数据分析、数据挖掘、BI及机器学习场景。掌握其核心功能、熟练操作流程、遵循最佳实践,可以帮助用户高效、安全地管理和利用海量数据。以下是一个关于MaxCompute产品使用的合集,涵盖了其核心功能、应用场景、操作流程以及最佳实践等内容。
|
1月前
|
前端开发 Java 关系型数据库
通过HTML网页对mysql数据库进行增删改查(CRUD实例)
通过HTML网页对mysql数据库进行增删改查(CRUD实例)
141 0
|
3月前
|
关系型数据库 MySQL
mysql配置文件的使用
mysql配置文件的使用
26 1
mysql配置文件的使用
|
3月前
|
存储 关系型数据库 MySQL
|
3月前
|
缓存 分布式计算 关系型数据库
数据管理DMS操作报错合集之当进行RDS实例的可用区迁移时,提示“缓存清理”是什么意思
数据管理DMS(Data Management Service)是阿里云提供的数据库管理和运维服务,它支持多种数据库类型,包括RDS、PolarDB、MongoDB等。在使用DMS进行数据库操作时,可能会遇到各种报错情况。以下是一些常见的DMS操作报错及其可能的原因与解决措施的合集。
|
3月前
|
SQL 关系型数据库 数据库
nacos 2.2.3版本 查看配置文件的历史版本的接口 是针对MySQL数据库的sql 改成postgresql后 sql语句报错 该怎么解决
在Nacos 2.2.3中切换到PostgreSQL后,执行配置文件历史版本分页查询出错,因`LIMIT 0, 10`语法不被PostgreSQL支持,需改为`LIMIT 10 OFFSET 0`。仅当存在历史版本时报错。解决方案是调整查询SQL以兼容PostgreSQL语法。

热门文章

最新文章

推荐镜像

更多