setenforce 0
service iptables stop
mysql -u root -p
Aaa111222333
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT
==========================
Can't connect to MySQL server (10060)
http://database.51cto.com/art/201107/274565.htm
setenforce 0 //设置为0
service iptables stop //临时关闭防火墙服务
mysql -u root -p //登录MySQL
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION; //任何远程主机都可以访问数据库
mysql> FLUSH PRIVILEGES; //需要输入次命令使修改生效
mysql> EXIT //退出
也可以通过修改表来实现远程:
mysql -u root -p
mysql> use mysql;
mysql> update user set host = '%' where user = 'root';
mysql> select host, user from user;