{"id":52320,"date":"2024-12-03T09:02:36","date_gmt":"2024-12-03T01:02:36","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52320\/"},"modified":"2024-12-03T09:02:36","modified_gmt":"2024-12-03T01:02:36","slug":"linux%e4%b8%8b%e5%a6%82%e4%bd%95%e4%bf%ae%e6%94%b9mysql%e5%af%86%e7%a0%81","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52320\/","title":{"rendered":"Linux\u4e0b\u5982\u4f55\u4fee\u6539mysql\u5bc6\u7801"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>Linux\u4e0b\u5982\u4f55\u4fee\u6539mysql\u5bc6\u7801<\/h1>\n<p>\u5c0f\u4f19\u4f34\u4eec\u6709\u6ca1\u6709\u89c9\u5f97\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u5f88\u6709\u610f\u601d\uff1f\u6709\u610f\u601d\u5c31\u5bf9\u4e86\uff01\u4eca\u5929\u5c31\u7ed9\u5927\u5bb6\u5e26\u6765<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aLinux\u4e0b\u5982\u4f55\u4fee\u6539mysql\u5bc6\u7801\u300b<\/span>\uff0c\u4ee5\u4e0b\u5185\u5bb9\u5c06\u4f1a\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\uff0c\u82e5\u662f\u5728\u5b66\u4e60\u4e2d\u5bf9\u5176\u4e2d\u90e8\u5206\u77e5\u8bc6\u70b9\u6709\u7591\u95ee\uff0c\u6216\u8bb8\u770b\u4e86\u672c\u6587\u5c31\u80fd\u5e2e\u5230\u4f60\uff01<\/p>\n<p>\u521d\u59cb\u5bc6\u7801\u4e3a\u7a7a\uff0c\u4f7f\u7528\u7a7a\u5bc6\u7801\u767b\u9646mysql\u6267\u884c\u4e0b\u5217\u8bed\u53e5<\/p>\n<pre>mysql&gt;use&nbsp;mysql;\nmysql&gt;&nbsp;update&nbsp;user&nbsp;set&nbsp;password=password(\"root\")&nbsp;where&nbsp;user='root';\nmysql&gt;&nbsp;flush&nbsp;privileges;\nmysql&gt;&nbsp;quit;\n\u4fee\u6539\/opt\/lampp\/phpmyadmin\/config.inc.php<\/pre>\n<p>\u627e\u5230\u5982\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre>$cfg['servers'][$i]['auth_type']&nbsp;=&nbsp;'config';\n$cfg['servers'][$i]['user']&nbsp;=&nbsp;'root';\n$cfg['servers'][$i]['password']&nbsp;=&nbsp;'';\n$cfg['servers'][$i]['extension']&nbsp;=&nbsp;'mysql';\n$cfg['servers'][$i]['allownopassword']&nbsp;=&nbsp;true;<\/pre>\n<p>\u4fee\u6539\u4e3a\uff1a<\/p>\n<pre>$cfg['servers'][$i]['auth_type']&nbsp;=&nbsp;'config';\n$cfg['servers'][$i]['user']&nbsp;=&nbsp;'root';\n$cfg['servers'][$i]['password']&nbsp;=&nbsp;'root';\n$cfg['servers'][$i]['extension']&nbsp;=&nbsp;'mysql';\n$cfg['servers'][$i]['allownopassword']&nbsp;=&nbsp;true;<\/pre>\n<p>\u6587\u4e2d\u5173\u4e8emysql,Linux\u7684\u77e5\u8bc6\u4ecb\u7ecd\uff0c\u5e0c\u671b\u5bf9\u4f60\u7684\u5b66\u4e60\u6709\u6240\u5e2e\u52a9\uff01\u82e5\u662f\u53d7\u76ca\u532a\u6d45\uff0c\u90a3\u5c31\u52a8\u52a8\u9f20\u6807\u6536\u85cf\u8fd9\u7bc7\u300aLinux\u4e0b\u5982\u4f55\u4fee\u6539mysql\u5bc6\u7801\u300b\u6587\u7ae0\u5427\uff0c\u4e5f\u53ef\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u4e86\u89e3\u76f8\u5173\u6280\u672f\u6587\u7ae0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u4e0b\u5982\u4f55\u4fee\u6539mysql\u5bc6\u7801 \u5c0f\u4f19\u4f34\u4eec\u6709\u6ca1\u6709\u89c9\u5f97\u5b66\u4e60\u6587\u7ae0\u5f88\u6709\u610f\u601d\uff1f\u6709\u610f\u601d\u5c31\u5bf9\u4e86\uff01\u4eca\u5929\u5c31\u7ed9\u5927\u5bb6\u5e26\u6765\u300aLinux\u4e0b\u5982\u4f55\u4fee\u6539mysql\u5bc6\u7801\u300b\uff0c\u4ee5\u4e0b\u5185\u5bb9\u5c06\u4f1a\u6d89\u53ca\u5230\uff0c\u82e5\u662f\u5728\u5b66\u4e60\u4e2d\u5bf9\u5176\u4e2d\u90e8\u5206\u77e5\u8bc6\u70b9\u6709\u7591\u95ee\uff0c\u6216\u8bb8\u770b\u4e86\u672c\u6587\u5c31\u80fd\u5e2e\u5230\u4f60\uff01 \u521d\u59cb\u5bc6\u7801\u4e3a\u7a7a\uff0c\u4f7f\u7528\u7a7a\u5bc6\u7801\u767b\u9646mysql\u6267\u884c\u4e0b\u5217\u8bed\u53e5 mysql&gt;use&nbsp;mysql; mysql&gt;&nbsp;update&nbsp;user&nbsp;set&nbsp;password=password(&#8220;root&#8221;)&nbsp;where&nbsp;user=&#8217;root&#8217;; mysql&gt;&nbsp;flush&nbsp;privileges; mysql&gt;&nbsp;quit; \u4fee\u6539\/opt\/lampp\/phpmyadmin\/config.inc.php \u627e\u5230\u5982\u4e0b\u4ee3\u7801\uff1a $cfg[&#8216;servers&#8217;][$i][&#8216;auth_type&#8217;]&nbsp;=&nbsp;&#8216;config&#8217;; $cfg[&#8216;servers&#8217;][$i][&#8216;user&#8217;]&nbsp;=&nbsp;&#8216;root&#8217;; $cfg[&#8216;servers&#8217;][$i][&#8216;password&#8217;]&nbsp;=&nbsp;&#8221;; $cfg[&#8216;servers&#8217;][$i][&#8216;extension&#8217;]&nbsp;=&nbsp;&#8216;mysql&#8217;; $cfg[&#8216;servers&#8217;][$i][&#8216;allownopassword&#8217;]&nbsp;=&nbsp;true; \u4fee\u6539\u4e3a\uff1a $cfg[&#8216;servers&#8217;][$i][&#8216;auth_type&#8217;]&nbsp;=&nbsp;&#8216;config&#8217;; $cfg[&#8216;servers&#8217;][$i][&#8216;user&#8217;]&nbsp;=&nbsp;&#8216;root&#8217;; $cfg[&#8216;servers&#8217;][$i][&#8216;password&#8217;]&nbsp;=&nbsp;&#8216;root&#8217;; $cfg[&#8216;servers&#8217;][$i][&#8216;extension&#8217;]&nbsp;=&nbsp;&#8216;mysql&#8217;; $cfg[&#8216;servers&#8217;][$i][&#8216;allownopassword&#8217;]&nbsp;=&nbsp;true; \u6587\u4e2d\u5173\u4e8emysql,Linux\u7684\u77e5\u8bc6\u4ecb\u7ecd\uff0c\u5e0c\u671b\u5bf9\u4f60\u7684\u5b66\u4e60\u6709\u6240\u5e2e\u52a9\uff01\u82e5\u662f\u53d7\u76ca\u532a\u6d45\uff0c\u90a3\u5c31\u52a8\u52a8\u9f20\u6807\u6536\u85cf\u8fd9\u7bc7\u300aLinux\u4e0b\u5982\u4f55\u4fee\u6539mysql\u5bc6\u7801\u300b\u6587\u7ae0\u5427\uff0c\u4e5f\u53ef\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u4e86\u89e3\u76f8\u5173\u6280\u672f\u6587\u7ae0\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-52320","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=52320"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52320\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}