{"id":218,"date":"2025-03-29T12:21:49","date_gmt":"2025-03-29T10:21:49","guid":{"rendered":"https:\/\/www.24x7serverguard.com\/blog\/?p=218"},"modified":"2025-03-29T12:46:22","modified_gmt":"2025-03-29T10:46:22","slug":"fixing-error-1045-28000-access-denied-for-user-rootlocalhost-in-mysql-plesk-server","status":"publish","type":"post","link":"https:\/\/www.24x7serverguard.com\/blog\/plesk\/fixing-error-1045-28000-access-denied-for-user-rootlocalhost-in-mysql-plesk-server\/","title":{"rendered":"Fixing ERROR 1045 (28000): Access Denied for User \u2018root\u2019@\u2019localhost\u2019 in MySQL (Plesk Server)"},"content":{"rendered":"\n<p>If you encounter the <strong>&#8220;ERROR 1045 (28000): Access denied for user \u2018root\u2019@\u2019localhost\u2019&#8221;<\/strong> error while accessing MySQL on a <strong>Plesk Linux server<\/strong>, follow these steps to regain access.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Retrieve the MySQL Admin Password<\/strong><\/h3>\n\n\n\n<p>Run the following command to find the <strong>admin password<\/strong> stored in Plesk:<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">cat \/etc\/psa\/.psa.shadow<\/mark><\/p>\n\n\n\n<p>\u2705 <strong>Example Output:<\/strong><\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">FfRBehWy<\/mark><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2: Log in to MySQL Using Admin Credentials<\/strong><\/h3>\n\n\n\n<p>Use the retrieved password to log in as the <strong>admin user<\/strong>:<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">mysql -u admin -pFfRBehWy<\/mark><\/p>\n\n\n\n<p>Once logged in, you will see:<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Welcome to the MySQL monitor.<br>Your MySQL connection id is 2555<br>Type &#8216;help;&#8217; or &#8216;\\h&#8217; for help.<\/mark><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 3: Enable Passwordless MySQL Login (Optional)<\/strong><\/h3>\n\n\n\n<p>To avoid entering the password every time, create a <strong>configuration file<\/strong>:<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">vi \/root\/.my.cnf<\/mark><\/p>\n\n\n\n<p>Add the following content:<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">[mysql]<br>user = admin<br>password = FfRBehWy<\/mark><\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">[mysqldump]<br>user = admin<br>password = FfRBehWy<\/mark><\/p>\n\n\n\n<p>Save and exit the file. Now, you can run <strong>mysql<\/strong> and <strong>mysqldump<\/strong> commands without entering the password.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you encounter the &#8220;ERROR 1045 (28000): Access denied for user \u2018root\u2019@\u2019localhost\u2019&#8221; error while accessing MySQL on a Plesk Linux server, follow these steps to regain access. Step 1: Retrieve the MySQL Admin Password Run the following command to find the admin password stored in Plesk: cat \/etc\/psa\/.psa.shadow \u2705 Example Output: FfRBehWy Step 2: Log [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":220,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[127],"tags":[140,142,143,141],"class_list":["post-218","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-plesk","tag-fix-error-1045-28000-mysql-access-denied-in-plesk","tag-how-to-find-mysql-admin-password-in-plesk","tag-login-to-mysql-without-a-password-in-plesk","tag-mysql-root-access-denied-solution-in-linux"],"_links":{"self":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/218","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/comments?post=218"}],"version-history":[{"count":1,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/218\/revisions"}],"predecessor-version":[{"id":219,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/218\/revisions\/219"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/media\/220"}],"wp:attachment":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/media?parent=218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/categories?post=218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/tags?post=218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}