MySQL5.7 远程登录设置

本文介绍了解决MySQL5.7初次安装后无法远程登录的问题。通过卸载password_validation插件并设置root用户密码,最终实现了远程登录的功能。

初次安装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指令。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值