mysql多实例配置文件

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

#++++++++++++++++++++++++++++++++ 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,如需转载请自行联系原作者


相关实践学习
如何快速连接云数据库RDS MySQL
本场景介绍如何通过阿里云数据管理服务DMS快速连接云数据库RDS MySQL,然后进行数据表的CRUD操作。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
打赏
0
0
0
0
347
分享
相关文章
环比、环比增长率、同比、同比增长率 ,占比,Mysql 8.0 实例(最简单的方法之一)(sample database classicmodels _No.2 )
环比、环比增长率、同比、同比增长率 ,占比,Mysql 8.0 实例(最简单的方法之一)(sample database classicmodels _No.2 )
181 1
全表数据核对 ,行数据核对,列数据核对,Mysql 8.0 实例(sample database classicmodels _No.3 )
全表数据核对 ,行数据核对,列数据核对,Mysql 8.0 实例(sample database classicmodels _No.3 )
75 0
全表数据核对 ,行数据核对,列数据核对,Mysql 8.0 实例(sample database classicmodels _No.3 )
【赵渝强老师】启动与关闭MySQL数据库实例
MySQL数据库安装完成后,可以通过命令脚本启动、查看状态、配置开机自启、查看自启列表及关闭数据库。本文提供了详细的操作步骤和示例代码,并附有视频讲解。
Django学习二:配置mysql,创建model实例,自动创建数据库表,对mysql数据库表已经创建好的进行直接操作和实验。
这篇文章是关于如何使用Django框架配置MySQL数据库,创建模型实例,并自动或手动创建数据库表,以及对这些表进行操作的详细教程。
125 0
Django学习二:配置mysql,创建model实例,自动创建数据库表,对mysql数据库表已经创建好的进行直接操作和实验。
mysql 8.0 的 建表 和八种 建表引擎实例
mysql 8.0 的 建表 和八种 建表引擎实例
44 0
Key_Value 形式 存储_5级省市城乡划分代码 (mysql 8.0 实例)
本文介绍了如何使用MySQL8.0数据库中的Key_Value形式存储全国统计用区划代码和城乡划分代码(5级),包括导入数据、通过数学函数提取省市区信息,以及查询5级行政区划的详细数据。
46 0
复购率 mysql 实例(sample database classicmodels _No.1 )
复购率 mysql 实例(sample database classicmodels _No.1 )
47 0
docker启动mysql多实例连接报错Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
docker启动mysql多实例连接报错Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
278 0
Prometheus结合Consul采集多个MySQL实例的监控指标
将 Prometheus 与 Consul 结合使用,实现对多个 MySQL 实例的自动发现与监控,不仅提高了监控的效率和准确性,也为管理动态扩缩容的数据库环境提供了强大的支持。通过细致配置每一部分,业务可以获得关键的性能指标和运行健康状况的即时反馈,进而优化资源配置,提高系统的稳定性和可用性。
201 3
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等