mysql报错ERROR 1820ALTER USER statement before executing this statement的解决办法
破解完mysql密码,使用新密码成功登陆进行授权操作的时候提示如下报错:
mysql> grant all privileges on . to 'root'@'%' identified by 'Data123';
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
初步分析应该是密码过期导致,下面附上解决办法
重新登陆数据库使用alter修改密码
mysql> alter user 'root'@'localhost' identified by 'Data123';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'root'@'%' identified by 'Data123';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.03 sec)
修改完密码在重新授权的时候成功解决
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。