{"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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">Zdroj:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:\/\/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=\"jVRdT9swFH33r7jqpHVDOB3jo6i01To1jEoFuqYdYi\/IJKYJdWxjO2T997tOStcKgZaHfNi5555zcm5IV0MsmLW9RqnpvVDxkmpm2MIwnTb6U265A6OUg5RbwUCbDPKVfRJguXnmpgAGdmUdz5NuS\/cJHl1t+CvMWCW80e\/6S\/8ggMgpXeN0SF0eO4TcrCaEfMW3sLdLOS5FP8fA5XNmlMy5dKC0y5SE7Vru6PYbl7dYM7y7nsyiXoNSu8w0RVHSUcfuBbcNQg49D2bcWlBhs0XVrga3sFIFPBbWeewdlpsapHkUwFgtMgnMVj6RGowW9RM5DmCuE+Z4BV05WaB1oNGfUpkEysylfs\/yNY9Y5TmTia2R+jCfDAezsN4MqtoonAErsEa6LGae7J11JpML6MFkEEU319Php+bl6oqXk3Wb5mcCeNA+3FyE0xDmHqcHTU+oCYOrIVwoVIor+LmYSPGhefbC4Hw8jy5gMh39Go3DH2G02XgqMpS4t7cHYZI5wBsysOD9R048Qc5gU7UsBM8ALfIOeHW4b\/fhQRk4DtrBCaBaEGiR2a88x5JCJN4m8KTXvQbjWTiFeYSnmvW3LaowGoZXs9H5KBzC91v4px1FXBuP2hQCFpgnBiUzEr0i5GQ7h2\/FsI3fT9pXQXRGbQfRKkD9VTIsSGVyJsQKJP+DdVnOt8AL+U5SCTndzeQLVOfN\/M3MCpwCUWUQI4whQLUGe5ebjHW8ip1cAtXdVjWMOLWGr+f2vT\/B78Sox85\/z3jqnLadjx+O2mfVCUnHS4U\/jAehygBD0HoquK3mrHV4eHzw5eD0qBWnTC44rZhST5O+KKBK0hjNUra9y\/sv\" \/> \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\">\u00a0\u00a0<\/span> \t\t<span class=\"pdf24Plugin-cp-text\">Send article as PDF<\/span> \t\t<span class=\"pdf24Plugin-cp-space\">\u00a0\u00a0<\/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: \u00a0\u00a0 Send article as PDF \u00a0\u00a0\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}]}}