mysql5.7修改密码与远程登录

来源:互联网 发布:福利app软件论坛 编辑:程序博客网 时间:2024/06/06 06:30

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即可

原创粉丝点击