ACCESSmysql远程访问和防火墙开启3306以及修改MySQLroot密码

1.修改mysql密码

mysql> set password for root@localhost = password(‘新密码’); 

2.防火墙开启3306端口

  A.打开防火墙配置文件:vi /etc/sysconfig/iptables

  B.修改3306 DROP为ACCESS :-A INPUT -m state –state NEW -m tcp -p tcp
–dport 3306 -j ACCEPT

  C.重启防火墙:service iptables restart

3.mysql开启远程访问

  A.登录MySQL之后,修改mysql数据库中user表中用户host的值为%

mysql> use mysql;

mysql> update user ``set host = ``'%'ACCESS,
where user = ``'root'``;

mysql> ``select host, user from user;//查看是否修改成功

  B.重启MySQL

相关文章