{"id":160,"date":"2021-03-16T19:01:04","date_gmt":"2021-03-16T19:01:04","guid":{"rendered":"https:\/\/wp.sheepchen.net\/?p=160"},"modified":"2021-03-16T19:07:58","modified_gmt":"2021-03-16T19:07:58","slug":"recover-your-mysql-password","status":"publish","type":"post","link":"https:\/\/wp.sheepchen.net\/?p=160","title":{"rendered":"Recover your MySQL password"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">What if you&#8217;ve forgotten your MySQL root user password? This could be quite the predicament &#8230; had the developers not thought of that eventuality. In order to recover the password, you simply have to follow these steps:<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Stop the current MySQL server process<\/li><li>Start the MySQL server with the command <em>sudo mysqld_safe &#8211;skip-grant-tables &#8211;skip-networking &amp;<\/em><\/li><li>Connect to the MySQL server as the root user with the command <em>mysql -u root<\/em><\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">At this point, you need to issue the following MySQL commands to reset the root password:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; use mysql;\n\u200bmysql&gt; update user set authentication_string=password('NEWPASSWORD') where user='root';\n\u200bmysql&gt; flush privileges;\n\u200bmysql&gt; quit<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After this you can shutdown the mysql-server and start it the normal way.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">(!) on very old mysql databases the &#8220;authentication_string&#8221; field is called &#8220;Password&#8221;. so the command looks like follows:<\/p>\n\n\n\n<pre id=\"block-be3b8a93-8a7d-46d1-af6d-315c48d1ae00\" class=\"wp-block-preformatted\">\u200bmysql> update user set Password=password('NEWPASSWORD') where user='root';<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">source: [<a href=\"https:\/\/www.techrepublic.com\/article\/how-to-set-change-and-recover-a-mysql-root-password\/\">link<\/a>]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What if you&#8217;ve forgotten your MySQL root user password? This could be quite the predicament &#8230; had the developers not thought of that eventuality. In order to recover the password, you simply have to follow these steps: Stop the current MySQL server process Start the MySQL server with the command sudo mysqld_safe &#8211;skip-grant-tables &#8211;skip-networking &amp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[3],"tags":[],"class_list":["post-160","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/wp.sheepchen.net\/index.php?rest_route=\/wp\/v2\/posts\/160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.sheepchen.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.sheepchen.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.sheepchen.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.sheepchen.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=160"}],"version-history":[{"count":3,"href":"https:\/\/wp.sheepchen.net\/index.php?rest_route=\/wp\/v2\/posts\/160\/revisions"}],"predecessor-version":[{"id":163,"href":"https:\/\/wp.sheepchen.net\/index.php?rest_route=\/wp\/v2\/posts\/160\/revisions\/163"}],"wp:attachment":[{"href":"https:\/\/wp.sheepchen.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.sheepchen.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.sheepchen.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}