{"id":1020,"date":"2015-10-07T10:16:29","date_gmt":"2015-10-07T08:16:29","guid":{"rendered":"\/\/www.mcgill.org.za\/stuff\/?p=1020"},"modified":"2017-01-06T10:59:18","modified_gmt":"2017-01-06T08:59:18","slug":"mysql-grant-fails","status":"publish","type":"post","link":"https:\/\/www.mcgill.org.za\/stuff\/archives\/1020","title":{"rendered":"The password hash doesn&#8217;t have the expected format"},"content":{"rendered":"<p>Today I thought I would grant permissions to use a mysql database.\u00a0 I did the regular thing, but it didn&#8217;t work:<\/p>\n<pre>mysql&gt; <strong>grant all on *.* to 'user'@'169.254.1.1' identified by 'somesecret';<\/strong>\r\nERROR 1827 (HY000): The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() function.<\/pre>\n<p>The reason turned out to be this:<\/p>\n<pre>[root@mysqlserver ~]# <strong>grep passwords \/etc\/my.cnf |<\/strong>\r\nold_passwords = 1<\/pre>\n<p>I don&#8217;t know how that affects it, but way to grant permissions is to override that setting:<\/p>\n<pre>mysql&gt; <strong>set old_passwords=0;<\/strong>\r\nQuery OK, 0 rows affected (0.00 sec)\r\n\r\nmysql&gt; <strong>grant all on *.* to 'user'@'169.254.1.1' identified by 'somesecret';<\/strong>\r\nQuery OK, 0 rows affected (0.01 sec)<\/pre>\n<p>And <em>viola<\/em> it works!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I thought I would grant permissions to use a mysql database.\u00a0 I did the regular thing, but it didn&#8217;t work: mysql&gt; grant all on *.* to &#8216;user&#8217;@&#8217;169.254.1.1&#8217; identified by &#8216;somesecret&#8217;; ERROR 1827 (HY000): The password hash doesn&#8217;t have the &hellip; <a href=\"https:\/\/www.mcgill.org.za\/stuff\/archives\/1020\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[20,193,190,114],"class_list":["post-1020","post","type-post","status-publish","format-standard","hentry","category-stuff","tag-mysql","tag-permissions","tag-stuff","tag-stupid"],"_links":{"self":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/1020","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/comments?post=1020"}],"version-history":[{"count":3,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/1020\/revisions"}],"predecessor-version":[{"id":1023,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/1020\/revisions\/1023"}],"wp:attachment":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/media?parent=1020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/categories?post=1020"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/tags?post=1020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}