MYSQL5.7.9改密码相关设置

Centos7上,对MySQL5.7开启远程连接。

1.修改/etc/my.cnf

[mysqld]
validate_password=off

2.命令行进入mysql

use mysql;
GRANT ALL ON *.* TO username@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
flush privileges;//重要

3.与防火墙有关

firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload

4.在Navicat中连接就可以了。

(adsbygoogle = window.adsbygoogle || []).push({});

改密码方式

update mysql.user set authentication_string=password('new_password') where user='root' and Host ='localhost';

flush privileges;
quit;
posted @ 2019-09-30 11:45  与世无争%  阅读(292)  评论(0编辑  收藏  举报