mysql 報錯ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executin
阿新 • • 發佈:2018-12-14
<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> 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> 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> 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> alter user 'root'@'localhost' identified by 'youpassword'; </p> <p>或者 </p> <p>mysql> set password=password("youpassword");<br><span></span>2、重新整理許可權<br><span></span>mysql> flush privileges;<br><span></span><br><span>mysql> help contents<br> You asked for help about help category: "Contents"<br> For more information, type 'help <item>', where <item> is one of the following<br> categories:<br> Account Management<br> Administration<br> Compound Statements<br> Data Definition<br> Data Manipulation<br> Data Types<br> Functions<br> Functions and Modifiers for Use with GROUP BY<br> Geographic Features<br> Help Metadata<br> Language Structure<br> Plugins<br> Procedures<br> Storage Engines<br> Table Maintenance<br> Transactions<br> User-Defined Functions<br> Utility<br> mysql></span><br></p> <p><br></p> <p>問題解決</p> </div> </div>