{"id":4738,"date":"2012-04-20T00:45:00","date_gmt":"2012-04-20T00:45:00","guid":{"rendered":""},"modified":"2026-04-18T22:48:37","modified_gmt":"2026-04-18T22:48:37","slug":"access-denied-for-user-usernamelocalhost-using-password-yes","status":"publish","type":"post","link":"https:\/\/hellem.org\/wblog\/?p=4738","title":{"rendered":"Access denied for user &#8216;USERNAME&#8217;@&#8217;LOCALHOST&#8217; (using password: YES)"},"content":{"rendered":"<p>I have struggled with an issue on our test server running our <a href=\"http:\/\/www.atlassian.com\/software\/jira\/overview\">Jira<\/a> test instance. Problem was that I could not get it to connect to the database. Jira 5.0 has a script, <a href=\"http:\/\/confluence.atlassian.com\/display\/JIRA\/Using+the+JIRA+Configuration+Tool\">config.sh<\/a>, in the bin-folder which pops up an application allowing you to apply settings and then verify them, one of the settings being the information needed to connect to the database. So, I created the database for Jira, added the user and granted the needed access. No problem connecting using command line<br \/>\n<!-- codeblock lang=\"BASH\" line=\"1\" --><\/p>\n<pre><code>mysql -u USERNAME -p DATABASENAME<\/code><\/pre>\n<p><!-- \/codeblock --><br \/>\nbut when trying &#8220;Test connection&#8221; using the Jira configuration tool it reported<br \/>\n<!-- codeblock lang=\"BASH\" line=\"1\" --><\/p>\n<pre><code>Access denied for user 'USERNAME'@'LOCALHOST' (using password: YES)<\/code><\/pre>\n<p><!-- \/codeblock --><br \/>\nCould not figure out why, until I connected as root and issued the following SQL-statement<\/p>\n<p><!-- codeblock lang=\"BASH\" line=\"1\" --><\/p>\n<pre><code>SELECT user, password,host F R O M  mysql.user;\r\n\r\nNote: I have some restrictions for my blog, so you need to edit F R O M<\/code><\/pre>\n<p><!-- \/codeblock --><\/p>\n<p>It showed that the encrypted password was not similar for my user for the two hosts which was defined, localhost and 127.0.0.1. I had recently updated for localhost and by the above error I thought that was sufficient, but now I also issued<br \/>\n<!-- codeblock lang=\"BASH\" line=\"1\" --><\/p>\n<pre><code>SET PASSWORD FOR 'USERNAME'@'127.0.0.1' EQUALSIGN OLD_PASSWORD('PASSWORD');\r\nSET PASSWORD FOR 'USERNAME'@'127.0.0.1' EQUALSIGN OLD_PASSWORD('PASSWORD');\r\n\r\nNote: I have some restrictions for my blog, so you need to edit EQUALSIGN\r\n<\/code><\/pre>\n<p><!-- \/codeblock --><\/p>\n<p>ensuring equal passwords for both hosts, and voila, problem solved.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have struggled with an issue on our test server running our Jira test instance. Problem was that I could not get it to connect to the database. Jira 5.0 has a script, config.sh, in the bin-folder which pops up an application allowing you to apply settings and then verify them, one of the settings [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[],"class_list":["post-4738","post","type-post","status-publish","format-standard","hentry","category-work-geek"],"_links":{"self":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/4738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4738"}],"version-history":[{"count":1,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/4738\/revisions"}],"predecessor-version":[{"id":12879,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/4738\/revisions\/12879"}],"wp:attachment":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}