mysql5.5.20複製配置
#從庫
grant all on *.* to'root'@'172.28.14.114'identified by '123456';
#修改my.cnf
[client]
#password = your_password
port = 3306
socket = /data/mysql/data/mysql.sock
[mysqld]
server_id=2
federated
binlog_ignore_db=mysql,information_schema,performance_schema
datadir=/data/mysql/data
tmpdir=/data/mysql/tmp
skip-external-locking
key_buffer_size = 256M
myisam_sort_buffer_size = 64M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 24
back_log = 1024
max_connections = 1200
table_definition_cache=120000
table_open_cache =120000
max_connect_errors = 300
max_allowed_packet = 24M
read_rnd_buffer_size = 4M
read_buffer_size = 4M
join_buffer_size = 4M
sort_buffer_size = 2M
query_cache_limit = 2M
query_cache_size = 1024M
query_cache_min_res_unit=2k
thread_cache_size = 1200
thread_stack = 128K
tmp_table_size = 256M
max_tmp_tables = 256
bulk_insert_buffer_size = 4M
binlog_cache_size = 2M
max_binlog_size = 128M
max_binlog_cache_size= 512M
# log
log-error=/data/mysql/log/log
log-bin=/data/mysql/log/mysql-bin
slow-query-log
slow-query-log-file=/data/mysql/log/slow.log
long_query_time=1
log-queries-not-using-indexes
# innodb
innodb_buffer_pool_size = 18432M
innodb_data_home_dir = /data/mysql/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_file_per_table= 1
innodb_log_group_home_dir = /data/mysql/log
innodb_log_files_in_group=3
innodb_log_file_size = 512M
innodb_log_buffer_size = 16M
#innodb_file_io_threads = 4
innodb_thread_concurrency = 24
innodb_lock_wait_timeout = 100
innodb_flush_method = 'O_DIRECT'
innodb_max_dirty_pages_pct = 75
# innodb_flush_log_at_trx_commit=2
# replication
replicate_wild_ignore_table=mysql.%,information_schema.%,performance_schema.%
relay_log=/data/mysql/log/relay-bin
log_slave_updates
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[myisamchk]
key_buffer_size = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
#主庫
mysql>grant replication slave on *.* torep_user@172.28.14.115identified by 'repl_user';
###### INNODB
$ mysqldump -uroot -p123456 --quick --single-transaction --master-data=1 --default-character-set=utf8 zwf > zwf.sql
###### MyISAM
mysql>flush tables with read lock;
mysal>show master status;
$ mysqldump -uroot -p123456 --opt zwf | mysql zwf -uroot -p123456 -h 172.28.14.115
mysql>unlock tables;
# 從庫 INNODB拷貝zwf.sql並找到change master對應的bin log和pos
# 從庫 MyISAM根據show master status結果找到change master對應的bin log和pos
mysql>change master to master_host='172.28.14.114',master_user='rep_user',master_password='repl_user',master_log_file='mysql-bin.000001',master_log_pos=694;
mysql>start slave;
mysql>show slave status\G;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/756652/viewspace-715454/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- mysql複製--主從複製配置MySql
- MySQL 8 複製(五)——配置GTID複製MySql
- Postgres 流複製配置
- MySQL 8 複製(九)——組複製聯機配置MySql
- 16.1.3 使用GTID 配置複製
- MYSQL主從複製製作配置方案MySql
- MYSQL主從複製配置(整理)MySql
- MySQL8.0.11 組複製配置MySql
- 5-5配置Mysql複製 基於日誌點的複製MySql
- 如何配置 pglogical | PostgreSQL 的流複製SQL
- mysql5.5.20備份MySql
- 淺複製和深複製的概念與值複製和指標複製(引用複製)有關 淺複製 “指標複製 深複製 值複製指標
- MySQL 主從複製安裝部署配置MySql
- Docker 教程十五配置MySQL 主從複製DockerMySql
- Mariadb之半同步複製叢集配置
- Redis replication主從複製原理及配置Redis
- Java引用複製、淺複製、深複製Java
- MySQL高可用之組複製技術(3):配置多主模型的組複製MySql模型
- MySQL高可用之組複製技術(2):配置單主模型的組複製MySql模型
- JS物件複製:深複製和淺複製JS物件
- 複製和引用複製
- Dcoker教程之九配置Redis主從複製Redis
- 用python生成oracle goldengate複製配置檔案PythonOracleGo
- MySQL主從複製配置心跳功能介紹MySql
- poi操作excel,複製sheet,複製行,複製單元格,複製styleExcel
- 淺複製與深複製
- MySQL 8 複製(三)——延遲複製與部分複製MySql
- mysql5.5.20原始碼安裝MySql原始碼
- Mysql Master-slave複製簡單配置記錄MySqlAST
- mysql主從複製配置與問題解決MySql
- Mongodb 配置複製集,並啟用安全校驗MongoDB
- python 淺複製、深複製坑Python
- python 深複製和淺複製Python
- JavaScript 淺複製和深複製JavaScript
- 複製
- MySQL 5.7 多主一從(多源複製)同步配置MySql
- 基於配置檔案的redis的主從複製Redis
- MongoDB資料庫之主從複製配置實戰【轉】MongoDB資料庫