{"id":35,"date":"2010-08-11T12:20:05","date_gmt":"2010-08-11T11:20:05","guid":{"rendered":"http:\/\/blogs.silicontechnix.com\/?p=35"},"modified":"2010-08-11T12:21:18","modified_gmt":"2010-08-11T11:21:18","slug":"recovering-a-lost-mysql-root-password","status":"publish","type":"post","link":"https:\/\/blogs.silicontechnix.com\/?p=35","title":{"rendered":"Recovering a lost Mysql root password"},"content":{"rendered":"<p><strong><span style=\"text-decoration: underline;\">Lost MySQL root password Recovery<\/span><\/strong><\/p>\n<pre class=\"brush: bash;\">\/etc\/init.d\/mysql stop\r\nmysqld_safe --skip-grant-tables &amp;<\/pre>\n<p>This stops MySQL and reloads it without the authentication (grant) tables, so we can connect to MySQL without a password. Beware this locks out all of your applications until the password reset process is completed. Now we need to go in an reset the password<\/p>\n<pre class=\"brush: bash;\">su -\r\nmysql -u root -p<\/pre>\n<p>It will prompt you for a password, just hit enter. You should now be inside the MySQL terminal and ready to change the root password:<\/p>\n<pre class=\"brush: bash;\">update user set password=PASSWORD(\u201dNEW-PASSWORD\u201d) where User=\u2019root\u2019;<\/pre>\n<p>Of course, replace NEW-PASSWORD with your chosen root password. Now all that remains is to restart MySQL in the normal manner in order for it to pick up the authentication tables correctly and let your customers and applications back in<\/p>\n<pre class=\"brush: bash;\"># \/etc\/init.d\/mysql stop\r\n# \/etc\/init.d\/mysql start\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Lost MySQL root password Recovery \/etc\/init.d\/mysql stop mysqld_safe &#8211;skip-grant-tables &amp; This stops MySQL and reloads it without the authentication (grant) tables, so we can connect to MySQL without a password. Beware this locks out all of your applications until the password reset process is completed. Now we need to go in an reset the password [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[17],"tags":[19,20,18],"class_list":["post-35","post","type-post","status-publish","format-standard","hentry","category-security","tag-linux","tag-lost-password","tag-mysql"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p12j6H-z","_links":{"self":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts\/35","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=35"}],"version-history":[{"count":3,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts\/35\/revisions"}],"predecessor-version":[{"id":38,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts\/35\/revisions\/38"}],"wp:attachment":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=35"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=35"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=35"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}