{"id":885,"date":"2013-10-31T05:12:42","date_gmt":"2013-10-31T09:12:42","guid":{"rendered":"http:\/\/www.xavignu.com\/?p=885"},"modified":"2013-10-31T05:12:42","modified_gmt":"2013-10-31T09:12:42","slug":"setting-replication-mysql-version-5-5","status":"publish","type":"post","link":"https:\/\/www.xavignu.com\/?p=885","title":{"rendered":"Setting replication MySQL version 5.5"},"content":{"rendered":"<p>So the other day I performed an upgrade of MySQL on a linode and notice that it wont start if I kept my old my.cnf file. <\/p>\n<p>[text]<br \/>\n[11:47:06] user@linode1: ~ $ echo &#8216;SHOW VARIABLES LIKE &quot;%version%&quot;;&#8217; | mysql -u username -ppassword | grep innodb<br \/>\ninnodb_version  5.5.31<br \/>\n[11:47:20] user@linode1: ~ $<br \/>\n[\/text]<\/p>\n<p>[text]<br \/>\n131022 08:17:56 mysqld_safe Starting mysqld daemon with databases from \/var\/lib\/mysql<br \/>\n131022  8:17:56 [ERROR] An old style &#8211;language value with language specific part detected: \/usr\/share\/mysql\/english\/<br \/>\n131022  8:17:56 [ERROR] Use &#8211;lc-messages-dir without language specific part instead.<br \/>\n131022  8:17:56 [Note] Plugin &#8216;FEDERATED&#8217; is disabled.<br \/>\n131022  8:17:56 InnoDB: The InnoDB memory heap is disabled<br \/>\n131022  8:17:56 InnoDB: Mutexes and rw_locks use GCC atomic builtins<br \/>\n131022  8:17:56 InnoDB: Compressed tables use zlib 1.2.7<br \/>\n131022  8:17:56 InnoDB: Using Linux native AIO<br \/>\n131022  8:17:56 InnoDB: Initializing buffer pool, size = 128.0M<br \/>\n131022  8:17:56 InnoDB: Completed initialization of buffer pool<br \/>\n131022  8:17:56 InnoDB: highest supported file format is Barracuda.<br \/>\n131022  8:17:56  InnoDB: Waiting for the background threads to start<br \/>\n131022  8:17:57 InnoDB: 5.5.31 started; log sequence number 1678395<br \/>\n131022  8:17:57 [ERROR] \/usr\/sbin\/mysqld: unknown variable &#8216;master-host=192.168.140.120&#8242;<br \/>\n131022  8:17:57 [ERROR] Aborting<br \/>\n[\/text]<br \/>\nThing is the replication entries in my.cnf need to be removed\/commented out and salve needs to be set up from MySQL console.<\/p>\n<p>So here is my new my.cnf.<\/p>\n<p>[11:34:25] xavi@linode1: ~ $ sudo grep -v &#8220;^#&#8221; \/etc\/mysql\/my.cnf | grep -v &#8220;^$&#8221;<br \/>\n[text]<br \/>\n[client]<br \/>\nport            = 3306<br \/>\nsocket          = \/var\/run\/mysqld\/mysqld.sock<br \/>\n[mysqld_safe]<br \/>\nsocket          = \/var\/run\/mysqld\/mysqld.sock<br \/>\nnice            = 0<br \/>\n[mysqld]<br \/>\nserver-id       = 2<br \/>\nuser            = mysql<br \/>\npid-file        = \/var\/run\/mysqld\/mysqld.pid<br \/>\nsocket          = \/var\/run\/mysqld\/mysqld.sock<br \/>\nport            = 3306<br \/>\nbasedir         = \/usr<br \/>\ndatadir         = \/var\/lib\/mysql<br \/>\ntmpdir          = \/tmp<br \/>\nlanguage        = \/usr\/share\/mysql\/english<br \/>\nskip-external-locking<br \/>\nbind-address            = 192.168.137.234<br \/>\nkey_buffer              = 16M<br \/>\nmax_allowed_packet      = 16M<br \/>\nthread_stack            = 128K<br \/>\nthread_cache_size       = 8<br \/>\nmyisam-recover          = BACKUP<br \/>\nquery_cache_limit       = 1M<br \/>\nquery_cache_size        = 16M<br \/>\nexpire_logs_days        = 10<br \/>\nmax_binlog_size         = 100M<br \/>\n[mysqldump]<br \/>\nquick<br \/>\nquote-names<br \/>\nmax_allowed_packet      = 16M<br \/>\n[mysql]<br \/>\n[isamchk]<br \/>\nkey_buffer              = 16M<br \/>\n!includedir \/etc\/mysql\/conf.d\/<br \/>\n[\/text]<br \/>\n[11:34:37] xavi@linode1: ~ $ <\/p>\n<p>We load the above file or similar depending on your configuration. Now to configure slave we log into the MySQL CLI.<\/p>\n<p>[text][\/text]<br \/>\nmysql> STOP SLAVE;<br \/>\nmysql> CHANGE MASTER TO MASTER_HOST=&#8217;192.168.140.120&#8242;, MASTER_USER=&#8217;replication-user&#8217;, MASTER_PASSWORD=&#8217;password&#8217;, MASTER_LOG_FILE=&#8217;mysql-bin.000747&#8242;, MASTER_LOG_POS=75797;<br \/>\nmysql> START SLAVE;<br \/>\n[\/text]<\/p>\n<p>That&#8217;s it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So the other day I performed an upgrade of MySQL on a linode and notice that it wont start if I kept my old my.cnf file. [text] [11:47:06] user@linode1: ~ $ echo &#8216;SHOW VARIABLES LIKE &quot;%version%&quot;;&#8217; | mysql -u username -ppassword | grep innodb innodb_version 5.5.31 [11:47:20] user@linode1: ~ $ [\/text] [text] 131022 08:17:56 mysqld_safe [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[3],"tags":[56,6,51,70],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/pTQgt-eh","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/885"}],"collection":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=885"}],"version-history":[{"count":10,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/885\/revisions"}],"predecessor-version":[{"id":896,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/885\/revisions\/896"}],"wp:attachment":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=885"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}