美文网首页
mysql远程登录

mysql远程登录

作者: sorry510 | 来源:发表于2020-04-30 15:40 被阅读0次

进入 mysql

1. mysql -u root -p //登录MySQL
2. mysql> use mysql;
3. mysql> update user set host = '%' where user ='root'; //更新用户root(可以写你想用的任何用户)的host为%(表示所有连接都可以)
4. mysql> FLUSH PRIVILEGES;  //使修改生效

修改防火墙

1.找到my.cnf,一般在/etc/mysql/下面,将bind-address = 127.0.0.1 用#号注释掉(window没有这个配置)

  1. 在window自带的防火墙里的入站规则添加3306端口
  2. 如果使用的阿里云,请在端口中设置3306对外开放
### 创建账号和分配权限

grant replication slave,reload,super on . to slave@'%' identified by 'slave1';

相关文章

网友评论

      本文标题:mysql远程登录

      本文链接:https://www.haomeiwen.com/subject/dxaorqtx.html