{"id":3152,"date":"2010-08-29T16:09:38","date_gmt":"2010-08-29T20:09:38","guid":{"rendered":"http:\/\/blogs.n1zyy.com\/n1zyy\/?p=3152"},"modified":"2010-08-29T16:09:38","modified_gmt":"2010-08-29T20:09:38","slug":"mysql-replication-permission-denied-errors","status":"publish","type":"post","link":"https:\/\/blogs.n1zyy.com\/n1zyy\/2010\/08\/29\/mysql-replication-permission-denied-errors\/","title":{"rendered":"MySQL Replication &#8211; Permission Denied Errors"},"content":{"rendered":"<p>I spent a long time beating my head against the wall trying to solve this, so I thought I&#8217;d share it here in the hopes that it helps someone else.<\/p>\n<p>I picked up a very cheap VPS to serve as a backup for various services, and decided to use it as a MySQL slave for backup purposes, and to provide secondary DNS (with a MySQL backend). Despite having no problem maintaining a kind-of-complicated cluster of MySQL boxes at work, I could not for the life of me get basic replication running. It consistently failed:<\/p>\n<p><tt>100829 15:56:56 [ERROR] Slave I\/O thread: error connecting to master 'replication@127.0.0.1:7777': Error: 'Access denied for user 'replication'@'localhost' (using password: YES)'\u00a0 errno: 1045\u00a0 retry-time: 60\u00a0 retries: 86400<\/tt><\/p>\n<p>(Yes, 127.0.0.1 is the master. Port 7777 is an ssh tunnel.) I tore my hair out, and repeatedly dropped and re-created the replication user. I could connect by hand. I tripled-checked credentials. It just didn&#8217;t work. Some people advised that master.info was sometimes saved with incorrect information; I blew that file away and re-issued the CHANGE MASTER command. Still nothing.<\/p>\n<p>Finally, someone mentioned an oddity they discovered: with long passwords, replication just refused to connect. I&#8217;d used my favorite method of assigning passwords: &#8220;head \/dev\/urandom | shasum&#8221; So I changed my password to &#8216;password&#8217; (just for testing!), flushed privileges on the master, changed the password with CHANGE MASTER, and started the slave again. <em>Viola<\/em>.<\/p>\n<p>This wouldn&#8217;t be nearly as annoying if I could find it documented anywhere. I would argue that it&#8217;s a bug. But there it is &#8212; shorten your password. (12 characters is the limit I&#8217;ve seen put forth.)<\/p>","protected":false},"excerpt":{"rendered":"<p>I spent a long time beating my head against the wall trying to solve this, so I thought I&#8217;d share it here in the hopes that it helps someone else. I picked up a very cheap VPS to serve as &hellip; <a href=\"https:\/\/blogs.n1zyy.com\/n1zyy\/2010\/08\/29\/mysql-replication-permission-denied-errors\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3152","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts\/3152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/comments?post=3152"}],"version-history":[{"count":0,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts\/3152\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/media?parent=3152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/categories?post=3152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/tags?post=3152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}