![阿里云centos远程连接mysql 阿里云centos远程连接mysql](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700&webp=1)
首先在服务器管理控制台设置防火墙规则
添加规则
使用root登录到mysql
添加一个用户名,权限为%的远程连接用户
grant all on *.* to 'yuancheng'@'%' identified by '123456';
flush privileges;
ok,就可以用Navicat测试了
查看用户列表:
select host,user from mysql.user;
删除某个用户:
use mysql;
delete from user where user='yuancheng' and host='%';
flush privileges;
更改某个用户的密码:
update mysql.user set password=password('new password') where user='指定用户' and host='%';
摘自: