{"id":1347,"date":"2019-07-05T16:28:44","date_gmt":"2019-07-05T13:28:44","guid":{"rendered":"https:\/\/artem.services\/?p=1249"},"modified":"2019-08-01T15:30:48","modified_gmt":"2019-08-01T12:30:48","slug":"1347","status":"publish","type":"post","link":"https:\/\/artem.services\/?p=1347&lang=en","title":{"rendered":"\u00a0MySQL &#8212; Reset root password"},"content":{"rendered":"<p><span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">We stop the <strong>mysqld<\/strong> service and start it with the following keys:<\/span><\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo mysqld --skip-grant-tables --user=mysql &amp;amp;\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">Log in without a password:<\/span><\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmysql -u root\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>And run:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nFLUSH PRIVILEGES;\r\nALTER USER 'root'@'localhost' IDENTIFIED BY 'YOUR_NEW_ROOT_PASSWORD';\r\n\\q;\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span class=\"tlid-translation translation\" lang=\"en\"><span title=\"\">Now the <strong>mysqld<\/strong> service running in the background needs to be stopped.<\/span> <span class=\"\" title=\"\">We look at the process <strong>ID<\/strong>:<\/span><\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo ps aux | grep mysql\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">Kill the process:<\/span><\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo kill 12345\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">And start the <strong>mysqld<\/strong> service:<\/span><\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo systemctl start mysqld\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>We stop the mysqld service and start it with the following keys: &nbsp; Log in without a password: &nbsp; And run: &nbsp; Now the mysqld service running in the background needs to be stopped. We look at the process ID: &nbsp; Kill the process: &nbsp; And start the mysqld service:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[341],"tags":[371,481,1073],"_links":{"self":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1347"}],"collection":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1347"}],"version-history":[{"count":2,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1347\/revisions"}],"predecessor-version":[{"id":1352,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1347\/revisions\/1352"}],"wp:attachment":[{"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}