<br />
<b>Warning</b>:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/qtranslate-x/qtranslate_frontend.php</b> on line <b>497</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
<br />
<b>Warning</b>:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in <b>/home/users/2/flatworld/web/memoecho.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php</b> on line <b>340</b><br />
{"id":2394,"date":"2019-04-19T05:28:14","date_gmt":"2019-04-19T05:28:14","guid":{"rendered":"http:\/\/tech.memoecho.com\/?p=2394"},"modified":"2019-04-19T05:29:48","modified_gmt":"2019-04-19T05:29:48","slug":"mysql-accidentally-delete-root-user-or-no-root-user-linux","status":"publish","type":"post","link":"http:\/\/tech.memoecho.com\/zh\/mysql\/mysql-accidentally-delete-root-user-or-no-root-user-linux\/","title":{"rendered":"Mysql\u8bef\u5220root\u7528\u6237\u6216\u6ca1\u6709root\u7528\u6237\u2014\u2014linux"},"content":{"rendered":"<!-- WP QUADS Content Ad Plugin v. 2.0.19 -->\n<div class=\"quads-location quads-ad2\" id=\"quads-ad2\" style=\"float:none;margin:0px;\">\n\n <!-- WP QUADS - Quick AdSense Reloaded v.2.0.19 Content AdSense async --> \n\n\n<script type=\"text\/javascript\" >\nvar quads_screen_width = document.body.clientWidth;\nif ( quads_screen_width >= 1140 ) {document.write('<ins class=\"adsbygoogle\" style=\"display:inline-block;width:336px;height:280px;\" data-ad-client=\"pub-8568501110011894\" data-ad-slot=\"4911828489\" ><\/ins>');\r\n            (adsbygoogle = window.adsbygoogle || []).push({});\r\n            }if ( quads_screen_width >= 1024  && quads_screen_width < 1140 ) {document.write('<ins class=\"adsbygoogle\" style=\"display:inline-block;width:336px;height:280px;\" data-ad-client=\"pub-8568501110011894\" data-ad-slot=\"4911828489\" ><\/ins>');\r\n            (adsbygoogle = window.adsbygoogle || []).push({});\r\n            }if ( quads_screen_width >= 768  && quads_screen_width < 1024 ) {document.write('<ins class=\"adsbygoogle\" style=\"display:inline-block;width:336px;height:280px;\" data-ad-client=\"pub-8568501110011894\" data-ad-slot=\"4911828489\" ><\/ins>');\r\n            (adsbygoogle = window.adsbygoogle || []).push({});\r\n            }if ( quads_screen_width < 768 ) {document.write('<ins class=\"adsbygoogle\" style=\"display:inline-block;width:336px;height:280px;\" data-ad-client=\"pub-8568501110011894\" data-ad-slot=\"4911828489\" ><\/ins>');\r\n            (adsbygoogle = window.adsbygoogle || []).push({});\r\n            }\n<\/script>\n\n <!-- end WP QUADS --> \n\n\n<\/div>\n<p><\/p>\n<div class=\"artical-content-bak main-content editor-side-new\">\n<div id=\"result\" class=\"con editor-preview-side\">\n<p>\u00a0\u5728Linux\u4e2d\u6709\u65f6\u5b89\u88c5Mysql\u4f1a\u51fa\u73b0\u6ca1\u6709root\u7528\u6237\u7684\u72b6\u51b5\uff0c\u6216\u8005\u8bf4root\u8d26\u6237\u88ab\u4ecemysql.user\u8868\u4e2d\u8bef\u5220\u9664\uff0c\u8fd9\u6837\u5c31\u5bfc\u81f4\u5f88\u591a\u6743\u9650\u65e0\u6cd5\u63a7\u5236\u3002<\/p>\n<p>\u89e3\u51b3\u529e\u6cd5\u91cd\u65b0\u521b\u5efaroot\u7528\u6237\uff0c\u5e76\u6388\u4e88\u6240\u6709\u6743\u9650\uff0c\u5177\u4f53\u65b9\u6cd5\u5982\u4e0b\uff1a<br \/>\n1\u3001 \u4fee\u6539\/etc\/my.conf\u6587\u4ef6\uff0c\u6dfb\u52a0skip-grant-tables<\/p>\n<p>[mysqld]<\/p>\n<p>datadir=\/var\/lib\/mysql<br \/>\nsocket=\/var\/lib\/mysql\/mysql.sock<br \/>\nuser=mysql<br \/>\n# Disabling symbolic-links is recommended to prevent assorted security risks<br \/>\nsymbolic-links=0<\/p>\n<p>skip-grant-tables<\/p>\n<p>[mysqld_safe]<\/p>\n<p>log-error=\/var\/log\/mysqld.log<br \/>\npid-file=\/var\/run\/mysqld\/mysqld.pid<\/p>\n<p>2\u3001\u91cd\u542fmysql\u670d\u52a1<\/p>\n<blockquote><p>\/etc\/init.d\/mysqld restart<\/p><\/blockquote>\n<p>3\u3001\u4f7f\u7528\u4e0b\u5217\u547d\u4ee4\u767b\u9646mysql\uff0c\u65e0\u9700\u5bc6\u7801<\/p>\n<blockquote><p>[root@test1]# mysql<\/p><\/blockquote>\n<p>4\u3001\u767b\u9646\u540e\uff0c\u91cd\u65b0\u6dfb\u52a0root\u7528\u6237<\/p>\n<blockquote><p>mysql&gt; use mysql;<br \/>\nmysql&gt; insert into user set user=&#8217;root&#8217;,ssl_cipher=&#8221;,x509_issuer=&#8221;,x509_subject=&#8221;;<br \/>\nmysql&gt; update user set Host=&#8217;localhost&#8217;,select_priv=&#8217;y&#8217;,<\/p><\/blockquote>\n<blockquote><p>mysql&gt;Alter_priv=&#8217;y&#8217;,delete_priv=&#8217;y&#8217;,create_priv=&#8217;y&#8217;,drop_priv=&#8217;y&#8217;,reload_priv=&#8217;y&#8217;,shutdown_priv=&#8217;y&#8217;,Process_priv=&#8217;y&#8217;,file_priv=&#8217;y&#8217;,grant_priv=&#8217;y&#8217;,References_priv=&#8217;y&#8217;,index_priv=&#8217;y&#8217;,create_user_priv=&#8217;y&#8217;,show_db_priv=&#8217;y&#8217;,super_priv=&#8217;y&#8217;,create_tmp_table_priv=&#8217;y&#8217;,Lock_tables_priv=&#8217;y&#8217;,execute_priv=&#8217;y&#8217;,repl_slave_priv=&#8217;y&#8217;,repl_client_priv=&#8217;y&#8217;,create_view_priv=&#8217;y&#8217;,show_view_priv=&#8217;y&#8217;,create_routine_priv=&#8217;y&#8217;,alter_routine_priv=&#8217;y&#8217;,create_user_priv=&#8217;y&#8217; where user=&#8217;root&#8217;;<\/p>\n<!-- WP QUADS Content Ad Plugin v. 2.0.19 -->\n<div class=\"quads-location quads-ad2\" id=\"quads-ad2\" style=\"float:none;margin:0px;\">\n\n <!-- WP QUADS - Quick AdSense Reloaded v.2.0.19 Content AdSense async --> \n\n\n<script type=\"text\/javascript\" >\nvar quads_screen_width = document.body.clientWidth;\nif ( quads_screen_width >= 1140 ) {document.write('<ins class=\"adsbygoogle\" style=\"display:inline-block;width:336px;height:280px;\" data-ad-client=\"pub-8568501110011894\" data-ad-slot=\"4911828489\" ><\/ins>');\r\n            (adsbygoogle = window.adsbygoogle || []).push({});\r\n            }if ( quads_screen_width >= 1024  && quads_screen_width < 1140 ) {document.write('<ins class=\"adsbygoogle\" style=\"display:inline-block;width:336px;height:280px;\" data-ad-client=\"pub-8568501110011894\" data-ad-slot=\"4911828489\" ><\/ins>');\r\n            (adsbygoogle = window.adsbygoogle || []).push({});\r\n            }if ( quads_screen_width >= 768  && quads_screen_width < 1024 ) {document.write('<ins class=\"adsbygoogle\" style=\"display:inline-block;width:336px;height:280px;\" data-ad-client=\"pub-8568501110011894\" data-ad-slot=\"4911828489\" ><\/ins>');\r\n            (adsbygoogle = window.adsbygoogle || []).push({});\r\n            }if ( quads_screen_width < 768 ) {document.write('<ins class=\"adsbygoogle\" style=\"display:inline-block;width:336px;height:280px;\" data-ad-client=\"pub-8568501110011894\" data-ad-slot=\"4911828489\" ><\/ins>');\r\n            (adsbygoogle = window.adsbygoogle || []).push({});\r\n            }\n<\/script>\n\n <!-- end WP QUADS --> \n\n\n<\/div>\n<\/blockquote>\n<blockquote><p>mysql&gt; quit;<\/p><\/blockquote>\n<p>5. \u4f7f\u7528\u4e0b\u5217\u547d\u4ee4\u91cd\u65b0\u767b\u9646\uff0c \u8bbe\u7f6eroot\u7684\u5bc6\u7801<\/p>\n<blockquote><p>mysql&gt; mysql -u root<br \/>\nmysql&gt; update mysql.user set password=password(&#8216;yourrootpasswd&#8217;) where \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0user=&#8217;root&#8217;;<br \/>\nmysql&gt; update user set host = &#8216;%&#8217; where user = &#8216;root&#8217;;<\/p><\/blockquote>\n<blockquote><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/%\u8868\u793a\u8bbe\u7f6e\u8fdc\u7a0b\u673a\u5668\u53ef\u8bbf\u95eemysql\u3002<br \/>\nmysql&gt; flush privileges;<br \/>\nmysql&gt; quit;<\/p><\/blockquote>\n<p>6. \u4fee\u6539\/etc\/my.conf\u6587\u4ef6\uff0c\u5c06skip-grant-tables\u53bb\u6389\uff0c\u7136\u540e\u91cd\u542fmysql<\/p>\n<blockquote><p>[root@test1]# \/etc\/init.d\/mysqld restart<\/p><\/blockquote>\n<p>7. \u6b63\u5e38\u5219\u4e00\u5207OK<\/p>\n<\/div>\n<\/div>\n<p>","protected":false},"excerpt":{"rendered":"<p>\u00a0\u5728Linux\u4e2d\u6709\u65f6\u5b89\u88c5Mysql\u4f1a\u51fa\u73b0\u6ca1\u6709root\u7528\u6237\u7684\u72b6\u51b5\uff0c\u6216\u8005\u8bf4root\u8d26\u6237\u88ab\u4ecemysql.user\u8868\u4e2d\u8bef\u5220\u9664\uff0c\u8fd9\u6837\u5c31\u5bfc\u81f4\u5f88\u591a\u6743\u9650\u65e0\u6cd5\u63a7\u5236\u3002 \u89e3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[32],"tags":[],"pwapp_after_post_content":"","pwapp_before_post_content":"","androapp_header":"","pwapp_author":{"ID":1,"name":"enadmin","slug":"enadmin"},"pwapp_terms":{"category":[{"term_id":32,"name":"mysql","slug":"mysql","term_group":0,"term_taxonomy_id":32,"taxonomy":"category","description":"","parent":0,"count":21,"filter":"raw","cat_ID":32,"category_count":21,"category_description":"","cat_name":"mysql","category_nicename":"mysql","category_parent":0,"ID":32}]},"pwapp_feed_image_dimension_type":"preview","pwapp_post_image":null,"share_image":null,"featured_image_showhide":"show","pwapp_excerpt":"<p>\u00a0\u5728Linux\u4e2d\u6709\u65f6\u5b89\u88c5Mysql\u4f1a\u51fa\u73b0\u6ca1\u6709root\u7528\u6237\u7684\u72b6\u51b5\uff0c\u6216\u8005\u8bf4root\u8d26\u6237\u88ab\u4ecemysql.user\u8868\u4e2d\u8bef\u5220\u9664\uff0c\u8fd9\u6837\u5c31\u5bfc\u81f4\u5f88\u591a\u6743\u9650\u65e0\u6cd5\u63a7\u5236\u3002 \u89e3 [&hellip;]<\/p>\n","pwapp_title":"Mysql\u8bef\u5220root\u7528\u6237\u6216\u6ca1\u6709root\u7528\u6237\u2014\u2014linux","androapp_image_list":[],"pwapp_post_content":"<style type=\"text\/css\">androapp img{\r\n    max-width: 100%;\r\n    height: auto;\r\n}\r\niframe{\r\n    max-width: 100%;    \r\n}\r\nfigure {\r\n    max-width: 100%;\r\n    height: auto;\r\n}\r\nimg{\r\n    max-width: 100% !important;\r\n    height: auto;\r\n}\r\ndiv {\r\n    max-width: 100% !important;\r\n}\r\nspan {\r\n    max-width:100%;\r\n    overflow: auto;\r\n}\r\naudio {\r\n    display:block;\r\n    visibility:visible !important;\r\n}\r\nvideo{\r\n    width:100%;\r\n    height:auto;\r\n}\r\n<\/style><div class='androapp'><p><\/p>\n<div class=\"artical-content-bak main-content editor-side-new\">\n<div id=\"result\" class=\"con editor-preview-side\">\n<p>\u00a0\u5728Linux\u4e2d\u6709\u65f6\u5b89\u88c5Mysql\u4f1a\u51fa\u73b0\u6ca1\u6709root\u7528\u6237\u7684\u72b6\u51b5\uff0c\u6216\u8005\u8bf4root\u8d26\u6237\u88ab\u4ecemysql.user\u8868\u4e2d\u8bef\u5220\u9664\uff0c\u8fd9\u6837\u5c31\u5bfc\u81f4\u5f88\u591a\u6743\u9650\u65e0\u6cd5\u63a7\u5236\u3002<\/p>\n<p>\u89e3\u51b3\u529e\u6cd5\u91cd\u65b0\u521b\u5efaroot\u7528\u6237\uff0c\u5e76\u6388\u4e88\u6240\u6709\u6743\u9650\uff0c\u5177\u4f53\u65b9\u6cd5\u5982\u4e0b\uff1a<br \/>\n1\u3001 \u4fee\u6539\/etc\/my.conf\u6587\u4ef6\uff0c\u6dfb\u52a0skip-grant-tables<\/p>\n<p>[mysqld]<\/p>\n<p>datadir=\/var\/lib\/mysql<br \/>\nsocket=\/var\/lib\/mysql\/mysql.sock<br \/>\nuser=mysql<br \/>\n# Disabling symbolic-links is recommended to prevent assorted security risks<br \/>\nsymbolic-links=0<\/p>\n<p>skip-grant-tables<\/p>\n<p>[mysqld_safe]<\/p>\n<p>log-error=\/var\/log\/mysqld.log<br \/>\npid-file=\/var\/run\/mysqld\/mysqld.pid<\/p>\n<p>2\u3001\u91cd\u542fmysql\u670d\u52a1<\/p>\n<blockquote><p>\/etc\/init.d\/mysqld restart<\/p><\/blockquote>\n<p>3\u3001\u4f7f\u7528\u4e0b\u5217\u547d\u4ee4\u767b\u9646mysql\uff0c\u65e0\u9700\u5bc6\u7801<\/p>\n<blockquote><p>[root@test1]# mysql<\/p><\/blockquote>\n<p>4\u3001\u767b\u9646\u540e\uff0c\u91cd\u65b0\u6dfb\u52a0root\u7528\u6237<\/p>\n<blockquote><p>mysql&gt; use mysql;<br \/>\nmysql&gt; insert into user set user=&#8217;root&#8217;,ssl_cipher=&#8221;,x509_issuer=&#8221;,x509_subject=&#8221;;<br \/>\nmysql&gt; update user set Host=&#8217;localhost&#8217;,select_priv=&#8217;y&#8217;,<\/p><\/blockquote>\n<blockquote><p>mysql&gt;Alter_priv=&#8217;y&#8217;,delete_priv=&#8217;y&#8217;,create_priv=&#8217;y&#8217;,drop_priv=&#8217;y&#8217;,reload_priv=&#8217;y&#8217;,shutdown_priv=&#8217;y&#8217;,Process_priv=&#8217;y&#8217;,file_priv=&#8217;y&#8217;,grant_priv=&#8217;y&#8217;,References_priv=&#8217;y&#8217;,index_priv=&#8217;y&#8217;,create_user_priv=&#8217;y&#8217;,show_db_priv=&#8217;y&#8217;,super_priv=&#8217;y&#8217;,create_tmp_table_priv=&#8217;y&#8217;,Lock_tables_priv=&#8217;y&#8217;,execute_priv=&#8217;y&#8217;,repl_slave_priv=&#8217;y&#8217;,repl_client_priv=&#8217;y&#8217;,create_view_priv=&#8217;y&#8217;,show_view_priv=&#8217;y&#8217;,create_routine_priv=&#8217;y&#8217;,alter_routine_priv=&#8217;y&#8217;,create_user_priv=&#8217;y&#8217; where user=&#8217;root&#8217;;<\/p><\/blockquote>\n<blockquote><p>mysql&gt; quit;<\/p><\/blockquote>\n<p>5. \u4f7f\u7528\u4e0b\u5217\u547d\u4ee4\u91cd\u65b0\u767b\u9646\uff0c \u8bbe\u7f6eroot\u7684\u5bc6\u7801<\/p>\n<blockquote><p>mysql&gt; mysql -u root<br \/>\nmysql&gt; update mysql.user set password=password(&#8216;yourrootpasswd&#8217;) where \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0user=&#8217;root&#8217;;<br \/>\nmysql&gt; update user set host = &#8216;%&#8217; where user = &#8216;root&#8217;;<\/p><\/blockquote>\n<blockquote><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/%\u8868\u793a\u8bbe\u7f6e\u8fdc\u7a0b\u673a\u5668\u53ef\u8bbf\u95eemysql\u3002<br \/>\nmysql&gt; flush privileges;<br \/>\nmysql&gt; quit;<\/p><\/blockquote>\n<p>6. \u4fee\u6539\/etc\/my.conf\u6587\u4ef6\uff0c\u5c06skip-grant-tables\u53bb\u6389\uff0c\u7136\u540e\u91cd\u542fmysql<\/p>\n<blockquote><p>[root@test1]# \/etc\/init.d\/mysqld restart<\/p><\/blockquote>\n<p>7. \u6b63\u5e38\u5219\u4e00\u5207OK<\/p>\n<\/div>\n<\/div>\n<p><\/p><\/div>","pwapp_post_content_type":"postprocessed","pwapp_preview_type":"excerpt","androapp_failover_post_content_type":"","share_text":"\u00a0\u5728Linux\u4e2d\u6709\u65f6\u5b89\u88c5Mysql\u4f1a\u51fa\u73b0\u6ca1\u6709root\u7528\u6237\u7684\u72b6\u51b5\uff0c\u6216\u8005\u8bf4root\u8d26\u6237\u88ab\u4ecemysql.user\u8868\u4e2d\u8bef\u5220\u9664\uff0c\u8fd9\u6837\u5c31\u5bfc\u81f4\u5f88\u591a\u6743\u9650\u65e0\u6cd5\u63a7\u5236\u3002 \u89e3 [&hellip;]\n\nvia http:\/\/tech.memoecho.com\/zh\/mysql\/mysql-accidentally-delete-root-user-or-no-root-user-linux\/","supercache":"androappsupercache","_links":{"self":[{"href":"http:\/\/tech.memoecho.com\/zh\/wp-json\/wp\/v2\/posts\/2394"}],"collection":[{"href":"http:\/\/tech.memoecho.com\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/tech.memoecho.com\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/tech.memoecho.com\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/tech.memoecho.com\/zh\/wp-json\/wp\/v2\/comments?post=2394"}],"version-history":[{"count":3,"href":"http:\/\/tech.memoecho.com\/zh\/wp-json\/wp\/v2\/posts\/2394\/revisions"}],"predecessor-version":[{"id":2399,"href":"http:\/\/tech.memoecho.com\/zh\/wp-json\/wp\/v2\/posts\/2394\/revisions\/2399"}],"wp:attachment":[{"href":"http:\/\/tech.memoecho.com\/zh\/wp-json\/wp\/v2\/media?parent=2394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/tech.memoecho.com\/zh\/wp-json\/wp\/v2\/categories?post=2394"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/tech.memoecho.com\/zh\/wp-json\/wp\/v2\/tags?post=2394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}