mysql5.7版本修改密码与远程登录
1.修改/etc/my.cnf 在最后增加一条
skip-grant-tables
重启mysql
2.登录mysql
mysql -uroot -p 回车
use mysql
执行
update user set authentication_string=password('你的密码') where User='root' and Host ='localhost';(修改密码)
update user set Host = '%' where User = 'root';(允许远程)
注释
skip-grant-tables
重启mysql即可