阿里云centos远程连接mysql

时间:2023-03-09 01:14:37
阿里云centos远程连接mysql

首先在服务器管理控制台设置防火墙规则

添加规则

阿里云centos远程连接mysql

使用root登录到mysql

添加一个用户名,权限为%的远程连接用户

阿里云centos远程连接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='%';


摘自:

  https://my.oschina.net/liujiest/blog/634150   # 远程连接

  http://blog.51cto.com/jschu/1693379   # 用户操作