初次安装MySQL5.7后,是不能远程登录的,需执行以下指令:
mysql> grant all privileges on *.* to 'root'@'%'with grant option;
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
为什么会出现这种错误,是因为5.7有个password_validation插件,将其卸载即可,操作指令如下:
mysql> uninstall plugin validate_password;
重新执行grant指令:
mysql> grant all privileges on *.* to 'root'@'%'with grant option;
ERROR 1133 (42000): Can't find any matching row in the user table
解决该错误:
mysql> grant all privileges on *.* to 'root'@'%'identified by '123456' with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)
注意:在执行grant指令之前,需要指定database:mysql,即执行上述grant指令前,需执行use mysql指令。
本文介绍了解决MySQL5.7初次安装后无法远程登录的问题。通过卸载password_validation插件并设置root用户密码,最终实现了远程登录的功能。
2054

被折叠的 条评论
为什么被折叠?



