#启动端口为3406的实例并添加账户
[mysql@app ~]$ mysqld_safe --defaults-file=/data/inst3406/data3406/my3406.cnf &
[mysql@app ~]$ mysql -P3406 #登陆到3406
master@localhost[(none)]> show variables like 'server_id';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| server_id | 3406 |
+---------------+-------+
#创建用于复制的账户
master@localhost[(none)]> grant replication slave,replication client on *.*
-> to repl@'192.168.1.177' identified by 'repl';
#初始化主库日志文件,生成环境慎用reset
master@localhost[(none)]> reset master;
Query OK, 0 rows affected (0.01 sec)
#查看主库的状态,日志初始化至000001,
master@localhost[(none)]> show master status,Position为120
+--------------------+----------+--------------+------------------+-------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+--------------------+----------+--------------+------------------+-------------------+
| inst3406bin.000001 | 120 | | | |
+--------------------+----------+--------------+------------------+-------------------+
热点聚合:
©CopyRight 2010-2020 EASCK.COM Inc All Rights Reserved. 易采站长站 版权所有
微信扫一扫