进入 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没有这个配置)
- 在window自带的防火墙里的入站规则添加3306端口
- 如果使用的阿里云,请在端口中设置3306对外开放
### 创建账号和分配权限
grant replication slave,reload,super on . to slave@'%' identified by 'slave1';








网友评论