{"id":842,"date":"2020-03-27T16:20:39","date_gmt":"2020-03-27T15:20:39","guid":{"rendered":"https:\/\/blog.mhasin.eu\/?p=842"},"modified":"2020-03-27T16:20:39","modified_gmt":"2020-03-27T15:20:39","slug":"centos-mysql-systemd-reset-root-password","status":"publish","type":"post","link":"https:\/\/blog.mhasin.eu\/?p=842","title":{"rendered":"CentOS  Mysql + systemd reset root password"},"content":{"rendered":"\n<p>Reset root hesla pri mysql serveru a systemd<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1. Stop mysql:\nsystemctl stop mysqld\n\n2. Set the mySQL environment option \nsystemctl set-environment MYSQLD_OPTS=\"--skip-grant-tables\"\n\n3. Start mysql usig the options you just set\nsystemctl start mysqld\n\n4. Login as root\nmysql -u root\n\n5. Update the root user password with these mysql commands\nmysql> UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPassword')\n    -> WHERE User = 'root' AND Host = 'localhost';\nmysql> FLUSH PRIVILEGES;\nmysql> quit\n\n*** Edit ***\nAs mentioned my shokulei in the comments, for 5.7.6 and later, you should use \n   mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';\nOr you'll get a warning\n\n6. Stop mysql\nsystemctl stop mysqld\n\n7. Unset the mySQL envitroment option so it starts normally next time\nsystemctl unset-environment MYSQLD_OPTS\n\n8. Start mysql normally:\nsystemctl start mysqld\n\nTry to login using your new password:\n7. mysql -u root -p<\/code><\/pre>\n\n\n\n<p>Zdroj:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;stackoverflow.com\/questions\/33510184\/change-mysql-root-password-on-centos7<\/code><\/pre>\n<div class=\"pdf24Plugin-cp\"> \t<form name=\"pdf24Form0\" method=\"post\" action=\"https:\/\/doc2pdf.pdf24.org\/wordpress.php\" target=\"pdf24PopWin\" onsubmit=\"var pdf24Win = window.open('about:blank', 'pdf24PopWin', 'resizable=yes,scrollbars=yes,width=600,height=250,left='+(screen.width\/2-300)+',top='+(screen.height\/3-125)+''); pdf24Win.focus(); if(typeof pdf24OnCreatePDF === 'function'){void(pdf24OnCreatePDF(this,pdf24Win));}\"> \t\t<input type=\"hidden\" name=\"blogCharset\" value=\"Cw1x07UAAA==\" \/><input type=\"hidden\" name=\"blogPosts\" value=\"MwQA\" \/><input type=\"hidden\" name=\"blogUrl\" value=\"yygpKSi20tdPyslP18vNSCzOzNNLLQUA\" \/><input type=\"hidden\" name=\"blogName\" value=\"c\/LxdwcA\" \/><input type=\"hidden\" name=\"blogValueEncoding\" value=\"gzdeflate base64\" \/><input type=\"hidden\" name=\"postId_0\" value=\"szAxAgA=\" \/><input type=\"hidden\" name=\"postTitle_0\" value=\"c07NK\/EPVlDwrSwuzFHQViiuLC5JzU1RKEotTi1RKMrPL1EoSCwuLs8vSgEA\" \/><input type=\"hidden\" name=\"postLink_0\" value=\"yygpKSi20tdPyslP18vNSCzOzNNLLdW3L7C1MDECAA==\" \/><input type=\"hidden\" name=\"postAuthor_0\" value=\"y00syfcwNAIA\" \/><input type=\"hidden\" name=\"postDateTime_0\" value=\"MzIwMtA1MNY1MlcwNLMyMLYytgQA\" \/><input type=\"hidden\" name=\"postContent_0\" value=\"jVTRbtowFH33V1wxaWxVHdYVSkUhGhPpQKItI7Cqe6ncxCUpjp3aTjP+ftcJZaCp0\/IQiJ177jnH54b0c3\/ODbeglbKQcCMY5DqFbGOeBRiuX7gugIHZGMuzuN\/KfYJXP9ccIsGMGTTKnD4IFa1ppGLe8Pvuxz\/xILQqr3F6pC6PLELuVmNCPuNb2NsmHJfC71Pg8iXVSmZcWlC5TZWE\/Vpu6f4bV3dYM7q\/mS3CQYNSs05zutJMWmrZg+CmQcip48G03QoqTLqq2tXgBjaqgKfCWId9wHJXgzTbHkzVKpXATOUTqcFoUT+RjgfLPGaWV9CVkwVaBzn6UyodQ5naxO0ZvuURqSxjMjY1kg\/L2Wi4COpNr6oNgwWwAmukTSPmyN4bq1O5ggHMhmF4ezMffWheba55Odu2aX4kgBf14XYczANYOpwBNB2hJgyvRzBWqBRX8LiYSPChefHK4HK6DMcwm09+TKbBtyDcbTwXKUo8OjqCIE4t4B8yNOD8R048Rs5gErUuBE8BLXIOOHW4b47hUWnoeF3vDFAtCLRIH1eeY0khYmcTONLbXsPpIpjDMsRbzfrLHlWYjILrxeRyEozg6x380Y4ibrRDbQoBK8wTg5JpiV4Rcrafw7di2MXzk+avIFqt9oNoFKD+KhkGpNIZE2IDkv\/CujTje+CF\/EdSCTk\/zOQrVO\/N\/C30BqwCUWUQI4whQLUae5e7jPWcioNcAs37rWoYcWo1386t\/zPW6qn334OcWJub3vt37e5FdUNm0VrhV+FRqNLDk249F9xUw9Q6Pe2cfDo5b7eihMkVpxUd6rjQV5pUSRqhI8p0D8n9Bg==\" \/> \t\t<a href=\"https:\/\/www.pdf24.org\" target=\"_blank\" title=\"www.pdf24.org\" rel=\"nofollow\"><img src=\"https:\/\/blog.mhasin.eu\/wp-content\/plugins\/pdf24-post-to-pdf\/img\/pdf_32x32.png\" alt=\"\" border=\"0\" height=\"32\" \/><\/a> \t\t<span class=\"pdf24Plugin-cp-space\">&nbsp;&nbsp;<\/span> \t\t<span class=\"pdf24Plugin-cp-text\">Send article as PDF<\/span> \t\t<span class=\"pdf24Plugin-cp-space\">&nbsp;&nbsp;<\/span> \t\t<input class=\"pdf24Plugin-cp-input\" style=\"margin: 0px;\" type=\"text\" name=\"sendEmailTo\" placeholder=\"Enter email address\" \/> \t\t<input class=\"pdf24Plugin-cp-submit\" style=\"margin: 0px;\" type=\"submit\" value=\"Send\" \/> \t<\/form> <\/div>","protected":false},"excerpt":{"rendered":"Reset root hesla pri mysql serveru a systemd Zdroj: &nbsp;&nbsp; Send article as PDF &nbsp;&nbsp;\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"arc_restricted_post":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-842","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts\/842","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=842"}],"version-history":[{"count":1,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts\/842\/revisions"}],"predecessor-version":[{"id":843,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts\/842\/revisions\/843"}],"wp:attachment":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}