{"id":60,"date":"2018-04-24T05:42:36","date_gmt":"2018-04-24T05:42:36","guid":{"rendered":"http:\/\/td_uid_11_5adec3cc5929d"},"modified":"2018-05-31T09:22:17","modified_gmt":"2018-05-31T09:22:17","slug":"reset-mysql-root-password","status":"publish","type":"post","link":"https:\/\/forumweb.hosting\/blog\/reset-mysql-root-password\/","title":{"rendered":"Reset MySQL root password"},"content":{"rendered":"<p>How to restore mysql root password on Linux when you forget password? This task will be very simple if you follow the steps in this article.<\/p>\n<p><strong>Step 1<\/strong> : Stop MySQL Server Service<br \/>\nYou run this command to stop MySQL Server on linux<\/p>\n<blockquote class=\"td_quote_box td_box_left\"><p>service mysqld stop<\/p><\/blockquote>\n<p><strong>Step 2<\/strong> : Restart MySQL Server without password<\/p>\n<blockquote class=\"td_quote_box td_box_left\"><p>mysqld_safe &#8211;skip-grant-tables &amp;<\/p><\/blockquote>\n<p>After you run the command above, you enter to continue running other commands<\/p>\n<blockquote class=\"td_quote_box td_box_left\"><p>[root@server ~]# 180531 10:57:35 mysqld_safe Logging to &#8216;\/var\/log\/mysqld.log&#8217;.<br \/>\n180531 10:57:35 mysqld_safe Starting mysqld daemon with databases from \/var\/lib\/mysql<\/p><\/blockquote>\n<p><strong>Step 3<\/strong> : Connect MySQL Server via MySQL client<\/p>\n<blockquote class=\"td_quote_box td_box_left\"><p>mysql -u root<\/p><\/blockquote>\n<blockquote class=\"td_quote_box td_box_left\"><p>[root@server ~]# mysql -u root<br \/>\nWelcome to the MySQL monitor. Commands end with ; or \\g.<br \/>\nYour MySQL connection id is 2<br \/>\nServer version: 5.1.73 Source distribution<\/p>\n<p>Copyright (c) 2000, 2013, Oracle and\/or its affiliates. All rights reserved.<\/p>\n<p>Oracle is a registered trademark of Oracle Corporation and\/or its<br \/>\naffiliates. Other names may be trademarks of their respective<br \/>\nowners.<\/p>\n<p>Type &#8216;help;&#8217; or &#8216;\\h&#8217; for help. Type &#8216;\\c&#8217; to clear the current input statement.<\/p>\n<p>mysql&gt;<\/p><\/blockquote>\n<p><strong>Step 4<\/strong>: Set\u00a0 new password MySQL Server for user root<\/p>\n<blockquote class=\"td_quote_box td_box_left\"><p>USE mysql;<br \/>\nUPDATE user set password=PASSWORD(&#8220;NEW-ROOT-PASSWORD&#8221;) WHERE User=&#8221;root&#8221;;<br \/>\nflush privileges;<br \/>\nquit<br \/>\nmysql&gt; USE mysql;<br \/>\nNo connection. Trying to reconnect&#8230;<br \/>\nConnection id: 3<br \/>\nCurrent database: *** NONE ***<\/p>\n<p>Reading table information for completion of table and column names<br \/>\nYou can turn off this feature to get a quicker startup with -A<\/p>\n<p>Database changed<br \/>\nmysql&gt; UPDATE user set password=PASSWORD(&#8220;NEW-ROOT-PASSWORD&#8221;) WHERE User=&#8221;root&#8221;;<br \/>\nQuery OK, 3 rows affected (0.01 sec)<br \/>\nRows matched: 3 Changed: 3 Warnings: 0<\/p>\n<p>mysql&gt; flush privileges;<br \/>\nQuery OK, 0 rows affected (0.00 sec)<\/p>\n<p>mysql&gt; quit<br \/>\nBye<br \/>\n[root@server ~]#<\/p><\/blockquote>\n<p><strong>Step 5<\/strong> : Restart MySQL Server<\/p>\n<blockquote class=\"td_quote_box td_box_left\"><p>service mysqld restart<\/p><\/blockquote>\n<p><strong>Step 6<\/strong> : Recheck new password of user root<\/p>\n<blockquote class=\"td_quote_box td_box_left\"><p>mysql -u root -p<\/p><\/blockquote>\n<p>Now you completely reset password for Mysql.<br \/>\nGood luck!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to restore mysql root password on Linux when you forget password? This task will be very simple if you follow the steps in this article. Step 1 : Stop MySQL Server Service You run this command to stop MySQL Server on linux service mysqld stop Step 2 : Restart MySQL Server without password mysqld_safe [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":533,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[65,86,85],"_links":{"self":[{"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/posts\/60"}],"collection":[{"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/comments?post=60"}],"version-history":[{"count":5,"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/posts\/60\/revisions"}],"predecessor-version":[{"id":532,"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/posts\/60\/revisions\/532"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/media\/533"}],"wp:attachment":[{"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/media?parent=60"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/categories?post=60"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/forumweb.hosting\/blog\/wp-json\/wp\/v2\/tags?post=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}