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;