{"id":7147,"date":"2017-11-28T08:44:04","date_gmt":"2017-11-28T00:44:04","guid":{"rendered":"http:\/\/rmohan.com\/?p=7147"},"modified":"2017-11-28T08:44:04","modified_gmt":"2017-11-28T00:44:04","slug":"master-and-slave-mysql-versions-are-mysql5-6-31","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=7147","title":{"rendered":"Master and slave MySQL versions are MySQL5.6.31"},"content":{"rendered":"<p>Master and slave MySQL versions are MySQL5.6.31<\/p>\n<p>Primary server IP: 192.168.1.178<\/p>\n<p>From the server IP: 192.168.1.145<\/p>\n<p>Master and slave are able to ping each other.<\/p>\n<p>A?192.168.1.178?Master?<br \/>\nB?192.168.1.145?Slave?<\/p>\n<p>&nbsp;<\/p>\n<p>service mysqld stop<br \/>\nservice mysqld start<br \/>\nservice mysqld restart<\/p>\n<p>&nbsp;<\/p>\n<p>mysql&gt; grant replication slave on *.* to &#8216;mohan&#8217;@&#8217;192.168.1.145&#8217; identified by &#8216;123456&#8217;;<br \/>\nmysql&gt; flush privileges;<\/p>\n<p>vi \/etc\/my.cnf<\/p>\n<p>port=3306<\/p>\n<p>binlog-ignore-db=mysql<br \/>\nserver-id=1<br \/>\nexpire-logs-days=7<br \/>\nbinlog-ignore-db=information_schema<br \/>\nbinlog-ignore-db=performation_schema<br \/>\nbinlog-ignore-db=sys<br \/>\nbinlog-ignore-db=gogs<\/p>\n<p>service mysqld restart<\/p>\n<p>mysql -u root -proot -P3306<br \/>\nmysql&gt; flush tables with read lock;<\/p>\n<p>show master status;<\/p>\n<p>mysql&gt; show master status;<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br \/>\n| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br \/>\n| mysql-bin.000001 | 154 | | mysql,information_schema,performation_schema,sys,gogs | |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br \/>\n1 row in set (0.00 sec)<\/p>\n<p>5 Slave<\/p>\n<p># For advice on how to change settings please see<br \/>\n# http:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/server-configuration-defaults.html<\/p>\n<p>[mysqld]<br \/>\n#<br \/>\n# Remove leading # and set to the amount of RAM for the most important data<br \/>\n# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.<br \/>\n# innodb_buffer_pool_size = 128M<br \/>\n#<br \/>\n# Remove leading # to turn on a very important data integrity option: logging<br \/>\n# changes to the binary log between backups.<br \/>\n# log_bin<br \/>\n#<br \/>\n# Remove leading # to set options mainly useful for reporting servers.<br \/>\n# The server defaults are faster for transactions and fast SELECTs.<br \/>\n# Adjust sizes as needed, experiment to find the optimal values.<br \/>\n# join_buffer_size = 128M<br \/>\n# sort_buffer_size = 2M<br \/>\n# read_rnd_buffer_size = 2M<br \/>\ndatadir=\/var\/lib\/mysql<br \/>\nsocket=\/var\/lib\/mysql\/mysql.sock<\/p>\n<p>log-bin=mysql-bin<br \/>\nserver-id=3<br \/>\nbinlog-ignore-db = mysql<br \/>\nbinlog-ignore-db = information_schema<br \/>\nbinlog-ignore-db = performation_schema<br \/>\nbinlog-ignore-db = sys<br \/>\nlog-slave-updates<br \/>\nslave-skip-errors=all<br \/>\nslave-net-timeout=60<\/p>\n<p># Disabling symbolic-links is recommended to prevent assorted security risks<br \/>\nsymbolic-links=0<\/p>\n<p>log-error=\/var\/log\/mysqld.log<br \/>\npid-file=\/var\/run\/mysqld\/mysqld.pid<\/p>\n<p>&nbsp;<\/p>\n<p>service mysqld restart<\/p>\n<p>&nbsp;<\/p>\n<p>mysql&gt; stop slave;<br \/>\nmysql&gt; change master to master_host=&#8217;192.168.1.178&#8242;,master_user=&#8217;mohan&#8217;,master_password=&#8217;123456&#8242;,master_log_file=&#8217;mysql-bin.000001&#8242;, master_log_pos= 154;<br \/>\nmysql&gt; show slave status \\G;<\/p>\n<p>mysql&gt; unlock tables;<br \/>\nQuery OK, 0 rows affected (0.00 sec)<\/p>\n<p>mysql&gt; start slave;<br \/>\nQuery OK, 0 rows affected (0.00 sec)<\/p>\n<p>mysql&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Master and slave MySQL versions are MySQL5.6.31<\/p>\n<p>Primary server IP: 192.168.1.178<\/p>\n<p>From the server IP: 192.168.1.145<\/p>\n<p>Master and slave are able to ping each other.<\/p>\n<p>A?192.168.1.178?Master? B?192.168.1.145?Slave?<\/p>\n<p>&nbsp;<\/p>\n<p>service mysqld stop service mysqld start service mysqld restart<\/p>\n<p>&nbsp;<\/p>\n<p>mysql&gt; grant replication slave on *.* to &#8216;mohan&#8217;@&#8217;192.168.1.145&#8217; identified by &#8216;123456&#8217;; mysql&gt; flush privileges;<\/p>\n<p>vi \/etc\/my.cnf<\/p>\n<p>port=3306<\/p>\n<p> [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7147"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7147"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7147\/revisions"}],"predecessor-version":[{"id":7148,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7147\/revisions\/7148"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}