1. 程式人生 > >mysql 報錯ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executin

mysql 報錯ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executin

<div id="article_content" class="article_content clearfix csdn-tracking-statistics" data-pid="blog" data-mod="popu_307" data-dsm="post">
								<div class="article-copyright">
					版權宣告:本文為博主原創文章,未經博主允許不得轉載。					https://blog.csdn.net/Brighter_Xiao/article/details/51556532				</div>
								            <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-bb1edad192.css">
						<div class="htmledit_views">
                
<p>昨天登入mysql(Server version: 5.7.11) 還是很好的,今天登入後執行任何命令都報下面的錯誤</p>
<p><span></span><br><span></span>mysql&gt; help contents<br><span></span>ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.<br><span></span>mysql&gt; help contents<br><span></span>ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.<br><span></span>mysql&gt; show databases;<br><span></span>ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.<br><span></span><br><span></span>解決辦法<br><span></span>1、 修改使用者密碼<br><span></span>mysql&gt; alter user 'root'@'localhost' identified by 'youpassword'; &nbsp;</p>
<p>或者 &nbsp; &nbsp; &nbsp;&nbsp;</p>
<p>mysql&gt;&nbsp;set password=password("youpassword");<br><span></span>2、重新整理許可權<br><span></span>mysql&gt; flush privileges;<br><span></span><br><span>mysql&gt; help contents<br>
You asked for help about help category: "Contents"<br>
For more information, type 'help &lt;item&gt;', where &lt;item&gt; is one of the following<br>
categories:<br>
&nbsp; &nbsp;Account Management<br>
&nbsp; &nbsp;Administration<br>
&nbsp; &nbsp;Compound Statements<br>
&nbsp; &nbsp;Data Definition<br>
&nbsp; &nbsp;Data Manipulation<br>
&nbsp; &nbsp;Data Types<br>
&nbsp; &nbsp;Functions<br>
&nbsp; &nbsp;Functions and Modifiers for Use with GROUP BY<br>
&nbsp; &nbsp;Geographic Features<br>
&nbsp; &nbsp;Help Metadata<br>
&nbsp; &nbsp;Language Structure<br>
&nbsp; &nbsp;Plugins<br>
&nbsp; &nbsp;Procedures<br>
&nbsp; &nbsp;Storage Engines<br>
&nbsp; &nbsp;Table Maintenance<br>
&nbsp; &nbsp;Transactions<br>
&nbsp; &nbsp;User-Defined Functions<br>
&nbsp; &nbsp;Utility<br>
mysql&gt;</span><br></p>
<p><br></p>
<p>問題解決</p>
            </div>
                </div>