{"id":126,"date":"2017-10-08T04:04:00","date_gmt":"2017-10-08T04:04:00","guid":{"rendered":"https:\/\/linuxadmin.melberi.com\/uncategorized\/how-to-reset-mysql-root-password-in"},"modified":"2017-10-08T08:17:48","modified_gmt":"2017-10-08T08:17:48","slug":"reset-mysql-root-password","status":"publish","type":"post","link":"https:\/\/www.melberi.com\/linuxadmin\/mysql\/reset-mysql-root-password","title":{"rendered":"How to reset mysql root password"},"content":{"rendered":"<p>Procedure to reset mysql root password in linux Cent OS Ubuntu Fedora Redhat Debian. Recover forger password in Command Line.<\/p>\n<p>Using the below simple steps, you can reset your mysql root password.<\/p>\n<h2><span style=\"text-decoration: underline;\">Reset mysql root Password<\/span><\/h2>\n<p><b>1) Stop mysql server:<\/b><\/p>\n<p><b style=\"background-color: #cccccc;\">#service mysqld stop<\/b><\/p>\n<p><b>2)Start mysql server in safe mode:<\/b><br \/>\nNow you have to start the mysql in safe mode with the following option<\/p>\n<p><b style=\"background-color: #cccccc;\">#mysqld_safe &#8211;user=mysql &#8211;skip-grant-tables &#8211;skip-networking &amp;<\/b><\/p>\n<p><b>3)Login to mysql server without password:<\/b><br \/>\nNow you have to login to mysql server without password Using mysql Root User<\/p>\n<p><b style=\"background-color: #cccccc;\">#mysql -u root mysql<\/b><br \/>\n<span style=\"color: #808080;\">Reading table information for completion of table and column names<\/span><br \/>\n<span style=\"color: #808080;\"> You can turn off this feature to get a quicker startup with -A<\/span><br \/>\n<span style=\"color: #808080;\"> Welcome to the MySQL monitor. Commands end with ; or g.<\/span><\/p>\n<p><span style=\"color: #808080;\"> Your MySQL connection id is 1<\/span><br \/>\n<span style=\"color: #808080;\"> Server version: 5.1.47 Source distribution<\/span><br \/>\n<span style=\"color: #808080;\"> Copyright (c) 2000, 2010, Oracle and\/or its affiliates. All rights reserved.<\/span><br \/>\n<span style=\"color: #808080;\"> This software comes with ABSOLUTELY NO WARRANTY. This is free software,<\/span><br \/>\n<span style=\"color: #808080;\"> and you are welcome to modify and redistribute it under the GPL v2 license<\/span><br \/>\n<span style=\"color: #808080;\"> Type &#8216;help;&#8217; or &#8216;h&#8217; for help. Type &#8216;c&#8217; to clear the current input statement.<\/span><br \/>\n<strong>mysql&gt;<\/strong><\/p>\n<p><b>4)Reset mysql root password:<\/b><\/p>\n<p>Run the below command without any mistake ( semicolon is a must )<\/p>\n<p><b style=\"background-color: #cccccc;\">mysql&gt; UPDATE user SET Password=PASSWORD(\u2018newrootpassword\u2019) WHERE User=\u2019root\u2019;<br \/>\nmysql&gt; flush privileges;<br \/>\nmysql&gt; exit<\/b><\/p>\n<p><b>5) Restart mysql server:<\/b><\/p>\n<p><b style=\"background-color: #cccccc;\">#service mysqld restart<\/b><\/p>\n<p><b>6) Login to MySQL With the New Password:<\/b><\/p>\n<p><b>root@server ]# mysql -u root -p<\/b><br \/>\nEnter password:<br \/>\nType &#8216;help;&#8217; or &#8216;h&#8217; for help. Type &#8216;c&#8217; to clear the current input statement.<\/p>\n<p><strong>mysql&gt;<\/strong><\/p>\n<p><span style=\"text-decoration: underline;\"><b>Related Posts:<\/b><\/span><br \/>\n<b>How to Create Database<\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Procedure to reset mysql root password in linux Cent OS Ubuntu Fedora Redhat Debian. Recover forger password in Command Line. Using the below simple steps, you can reset your mysql&#8230; <a href=\"https:\/\/www.melberi.com\/linuxadmin\/mysql\/reset-mysql-root-password\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88,98],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/126"}],"collection":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/comments?post=126"}],"version-history":[{"count":5,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/126\/revisions"}],"predecessor-version":[{"id":444,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/126\/revisions\/444"}],"wp:attachment":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/media?parent=126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/categories?post=126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/tags?post=126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}