mysql

查看mysql监听的端口:netstat -an | grep 3306 

远程连接报10065 防火墙没开通

/etc/sysconfig/  修改IPTABLE 添加
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT
重启防火墙
/etc/init.d/iptables restart

mysql远程访问授权
GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY 'admin' WITH GRANT OPTION;
 
GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY 'admin' WITH GRANT OPTION;
 
FLUSH PRIVILEGES ;

你可能感兴趣的:(mysql)