Yum-yinstallmakegcc-c ++ cmakebison-devel? Ncurses-develconfigure.sh: cmake-DCMAKE_INSTALL_PREFIXusrlocalmysql-DMYSQL_DATADIRdatamysql-DSYSCONFDIRetc-DWITH_MYISAM_STORAGE_ENGINE1-DWITH_INNOBASE_STORAGE_ENGINE1-D
Yum-y install make gcc-c ++ cmake bison-devel? Ncurses-devel configure. sh: cmake \-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \-DMYSQL_DATADIR =/data/mysql \-DSYSCONFDIR =/etc \-runtime = 1 \-DWITH_INNOBASE_STORAGE_ENGINE = 1 \-D
Yum-y install make gcc-c ++ cmake bison-devel? Ncurses-devel
Configure. sh:
cmake \-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \-DMYSQL_DATADIR=/data/mysql \-DSYSCONFDIR=/etc \-DWITH_MYISAM_STORAGE_ENGINE=1 \-DWITH_INNOBASE_STORAGE_ENGINE=1 \-DWITH_MEMORY_STORAGE_ENGINE=1 \-DWITH_READLINE=1 \-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \-DMYSQL_TCP_PORT=3306 \-DENABLED_LOCAL_INFILE=1 \-DWITH_PARTITION_STORAGE_ENGINE=1 \-DEXTRA_CHARSETS=all \-DDEFAULT_CHARSET=utf8 \-DDEFAULT_COLLATION=utf8_general_ci
Useradd mysql
Mkdir-p/data/mysql
./Mysql_install_db-basedir =/usr/local/mysql-datadir =/data/mysql/-user = mysql
Ln-s/usr/local/mysql/bin/*/usr/sbin/
Master/Slave
Master:
Configuration:
[Mysqld]
Log-bin = master-bin
Log-bin-index = master-bin.index
Innodb_file_per_table = 1
Max_connections = 3000
Socket =/var/lib/mysql. sock
Log-bin =
Binlog-format = ROW
Log-slave-updates = true
Gtid-mode = on
Enforce-gtid-consistency = true
Master-info-repository = TABLE
Relay-log-info-repository = TABLE
Sync-master-info = 1
Slave-parallel-workers = 2
Binlog-checksum = CRC32
Master-verify-checksum = 1
Slave-SQL-verify-checksum = 1
Binlog-rows-query-log_events = 1
Report-port = 3306
Port = 3306
Report-host = 125. 210 .*.*
Server_id = 1
Slow-query-log-file =/data/mysql/query-slow.log.
Long_query_time = 5
Explicit_defaults_for_timestamp = true
SLAVE:
Configuration:
[Mysqld]
Log-bin = master-bin
Log-bin-index = master-bin.index
Innodb_file_per_table = 1
Relay-log = relay-log
Relay-log-index = relay-log.index
Binlog-format = ROW
Log-slave-updates = true
Gtid-mode = on
Enforce-gtid-consistency = true
Master-info-repository = TABLE
Relay-log-info-repository = TABLE
Sync-master-info = 1
Slave-parallel-workers = 2
Binlog-checksum = CRC32
Master-verify-checksum = 1
Slave-SQL-verify-checksum = 1
Binlog-rows-query-log_events = 1
Report-port = 3306
Port = 3306
Report-host = 125.210.136.132
Server_id = 10
Start synchronization on the console
Change master to master_host = '192. 125. *. * ', master_user = 'repl', master_password = 'repl _ pass', master_auto_position = 1;
Query OK, 0 rows affected, 2 warnings (0.15 sec)
Start slave;
This article from: http://zacharyhu.org, original address: http://zacharyhu.org /? P = 536, thanks to the original author.