{"id":131752,"date":"2020-07-04T10:45:30","date_gmt":"2020-07-04T02:45:30","guid":{"rendered":"http:\/\/4563.org\/?p=131752"},"modified":"2020-07-04T10:45:30","modified_gmt":"2020-07-04T02:45:30","slug":"centos-%e4%b8%8b-mysql-%e5%bf%98%e8%ae%b0-root-%e5%af%86%e7%a0%81%e7%9a%84%e5%a4%84%e7%90%86%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=131752","title":{"rendered":"CentOS \u4e0b mysql \u5fd8\u8bb0 root \u5bc6\u7801\u7684\u5904\u7406\u65b9\u6cd5"},"content":{"rendered":"<p>\u672c\u6587\u6574\u7406\u8bb0\u5f55 CentOS \u4e0b mysql \u5fd8\u8bb0 root \u5bc6\u7801\u7684\u5904\u7406\u65b9\u6cd5\u3002<\/p>\n<h3><a href=\"https:\/\/www.studytime.xin\/article\/#\u4fee\u6539-mysql-\u914d\u7f6e\u6587\u4ef6\uff0c\u5728-mysqld-\u4e2d\u6dfb\u52a0-skip-grant-tables\uff0c\u8df3\u8fc7\u5bc6\u7801\u9a8c\u8bc1\u3002\" title=\"\u4fee\u6539 mysql \u914d\u7f6e\u6587\u4ef6\uff0c\u5728 [mysqld] \u4e2d\u6dfb\u52a0 skip-grant-tables\uff0c\u8df3\u8fc7\u5bc6\u7801\u9a8c\u8bc1\u3002\"><\/a>\u4fee\u6539 mysql \u914d\u7f6e\u6587\u4ef6\uff0c\u5728 <code>[mysqld]<\/code> \u4e2d\u6dfb\u52a0 <code>skip-grant-tables<\/code>\uff0c\u8df3\u8fc7\u5bc6\u7801\u9a8c\u8bc1\u3002<\/h3>\n<figure>\n<table>\n<tr>\n<td>\n<pre><span>1<\/span><br><span>2<\/span><br><span>3<\/span><br><span>4<\/span><br><\/pre>\n<\/td>\n<td>\n<pre><span>vim &#x2F;etc&#x2F;my.cnf<\/span><br><span><\/span><br><span>[mysqld]<\/span><br><span>skip-grant-tables<\/span><br><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/figure>\n<h3><a href=\"https:\/\/www.studytime.xin\/article\/#\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u91cd\u542fmysql\" title=\"\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u91cd\u542fmysql\"><\/a>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u91cd\u542fmysql<\/h3>\n<p><code>service mysql restart<\/code><\/p>\n<h3><a href=\"https:\/\/www.studytime.xin\/article\/#\u91cd\u65b0\u767b\u5f55\uff0c\u6b64\u65f6\u4f1a\u8df3\u8fc7\u5bc6\u7801\u9a8c\u8bc1\" title=\"\u91cd\u65b0\u767b\u5f55\uff0c\u6b64\u65f6\u4f1a\u8df3\u8fc7\u5bc6\u7801\u9a8c\u8bc1\"><\/a>\u91cd\u65b0\u767b\u5f55\uff0c\u6b64\u65f6\u4f1a\u8df3\u8fc7\u5bc6\u7801\u9a8c\u8bc1<\/h3>\n<figure>\n<table>\n<tr>\n<td>\n<pre><span>1<\/span><br><\/pre>\n<\/td>\n<td>\n<pre><span>mysql -uroot -p (\u76f4\u63a5\u70b9\u51fb\u56de\u8f66\uff0c\u5bc6\u7801\u4e3a\u7a7a)<\/span><br><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/figure>\n<h3><a href=\"https:\/\/www.studytime.xin\/article\/#\u9009\u62e9-mysql-\u6570\u636e\u5e93\" title=\"\u9009\u62e9 mysql \u6570\u636e\u5e93\"><\/a>\u9009\u62e9 mysql \u6570\u636e\u5e93<\/h3>\n<figure>\n<table>\n<tr>\n<td>\n<pre><span>1<\/span><br><\/pre>\n<\/td>\n<td>\n<pre><span>use mysql;<\/span><br><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/figure>\n<h3><a href=\"https:\/\/www.studytime.xin\/article\/#\u4fee\u6539root\u5bc6\u7801\" title=\"\u4fee\u6539root\u5bc6\u7801\"><\/a>\u4fee\u6539root\u5bc6\u7801<\/h3>\n<figure>\n<table>\n<tr>\n<td>\n<pre><span>1<\/span><br><\/pre>\n<\/td>\n<td>\n<pre><span>update user set authentication_string&#x3D;password(&#39;!Qaz123456&#39;) where user&#x3D;&#39;root&#39;;<\/span><br><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/figure>\n<h3><a href=\"https:\/\/www.studytime.xin\/article\/#\u5237\u65b0\u6743\u9650\" title=\"\u5237\u65b0\u6743\u9650\"><\/a>\u5237\u65b0\u6743\u9650<\/h3>\n<figure>\n<table>\n<tr>\n<td>\n<pre><span>1<\/span><br><span>2<\/span><br><\/pre>\n<\/td>\n<td>\n<pre><span>flush privileges;<\/span><br><span>exit;<\/span><br><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/figure>\n<h3><a href=\"https:\/\/www.studytime.xin\/article\/#\u5220\u9664-skip-grant-tables-\u914d\u7f6e\u6587\u4ef6\" title=\"\u5220\u9664 skip-grant-tables \u914d\u7f6e\u6587\u4ef6\"><\/a>\u5220\u9664 skip-grant-tables \u914d\u7f6e\u6587\u4ef6<\/h3>\n<h3><a href=\"https:\/\/www.studytime.xin\/article\/#\u91cd\u542fmysql\" title=\"\u91cd\u542fmysql\"><\/a>\u91cd\u542fmysql<\/h3>\n<figure>\n<table>\n<tr>\n<td>\n<pre><span>1<\/span><br><\/pre>\n<\/td>\n<td>\n<pre><span>service mysql restart<\/span><br><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u6574\u7406\u8bb0\u5f55 CentOS \u4e0b m&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/131752"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=131752"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/131752\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=131752"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=131752"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=131752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}